The code copy is as follows:
<%
classStringOperations
''****************************************************************************
''''@Function Description: Swap the string into a char array
''''@parameter description:-str[string]: string that needs to be converted
''''@Return value:-[Array]Char type array
''****************************************************************************
publicfunction toCharArray(byValstr)
redimcharArray(len(str))
fori=1tolen(str)
charArray(i-1)=Mid(str,i,1)
next
toCharArray=charArray
endfunction
''****************************************************************************
''''@Function Description: Convert an array into a string
''''@parameter description:-arr[Array]: data that needs to be converted
''''@Return value:-[string] string
''****************************************************************************
publicfunctionarrayToString(byValarr)
fori=0toUBound(arr)
strObj=strObj&arr(i)
next
arrayToString=strObj
endfunction
''****************************************************************************
''''@Function Description: Check whether the source string str starts with chars
''''@parameter description:-str[string]: source string
''''@parameter description:-chars[string]: Comparison character/string
''''@Return value:-[bool]
''****************************************************************************
publicfunctionstartsWith(byValstr,chars)
ifLeft(str,len(chars))=charsthen
startsWith=true
else
startsWith=false
endif
endfunction
''****************************************************************************
''''@Function Description: Check whether the source string str ends with chars
''''@parameter description:-str[string]: source string
''''@parameter description:-chars[string]: Comparison character/string
''''@Return value:-[bool]
''****************************************************************************
publicfunctionendsWith(byValstr,chars)
ifRight(str,len(chars))=charsthen
endsWith=true
else
endsWith=false
endif
endfunction
''****************************************************************************
''''@Function Description: Copy N strings