See related articles:
http://www.csdn.net/develop/read_article.asp?id=22695
This article has been added on the basis of this, adding a few functions suitable for Chinese websites to enter, maybe some have not replenished. Friends who are interested can add a little funch on this basis, but don't forget to share it. Intersection
<%
Class StringOperations
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @Function description: replace the string to the Char type array
'' @Parameter description: -dr [string]: string that needs to be converted
'' @Return Value: - [Array] Char type array
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public functions
Redim Chararray (Len (STR))
for i = 1 to len (STR)
chararray (i-1) = mid (str, i, 1)
next
ToCharRray = Chararray
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @Function description: convert a array into a string
'' @Parameter Description: -Arr [Array]: Data needed to be converted
'' @Return Value: - [String] string
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public functions (Byval ARR)
for i = 0 to ubound (ARR)
Strobj = Strobj & ARR (i)
next
arraytring = Strobj
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @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]
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public function startswith (byval str, chars)
if left (str, len (chars)) = chars then
startswith = true
else
startswith = false
end if
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @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]
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public function endswith (byval str, chars)
if right (str, len (chars)) = chars then
endswith = true
else
endswith = false
end if
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @Function description: Copy n string str
'' @Parameter description: -str [string]: source string
'' @Parameter description: -N [int]: Number of replicas
'' @Return Value: - [String] Copy string
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public function clone (byval str, n)
for i = 1 to n
Value = Value & Str
next
clone = value
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @Function description: Delete the front n characters of the source string STR
'' @Parameter description: -str [string]: source string
'' @Parameter description: -N [int]: Number of characters deleted
'' @Return Value: - [String] Deleted string
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public function trimstart (byval str, n)
Value = MID (STR, N+1)
trimstart = value
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @Function description: Delete the last n string of the source string STR
'' @Parameter description: -str [string]: source string
'' @Parameter description: -N [int]: Number of characters deleted
'' @Return Value: - [String] Deleted string
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
Public function trimend (Byval Str, N)
Value = Left (STR, Len (STR) -n))
trimend = value
end function
'***********************************************************************************************************************************************************************************************************************************************************************, *************************************
'' @Function description: Check whether the character Character is English character AZ or AZ
'' @Parameter description: -Character [Char]: The character checked
'' @Return Value: - [BOOL] If it is an English character, return true, otherwise False
'***********************
||||..