asp string function example
Use string functions to perform operations such as truncation, tailing, and case replacement on strings.
function syntax function
LenLen(string|varname) returns the number of characters in a string, or the number of bytes required to store a variable.
TrimTrim(string) removes the spaces before and after the string
LtrimLtrim(string) removes the spaces in front of the string
RtrimRtrim(string) removes the spaces after the string
MidMid(string,start,length) obtains the string of length starting from the start character of the string string. If the third parameter is omitted, it means the string starting from the start character to the end of the string.
LeftLeft(string,length) obtains a string of length length from the left side of the string string
RightRight(string,length) gets the length of the string from the right side of the string string
LCaseLCase(string) converts all uppercase letters in the string string to lowercase letters
UCaseUCase(string) converts all uppercase letters in string to uppercase letters
StrCompStrComp(string1,string2[, compare]) returns the comparison result of string1 string and string2 string. If the two strings are the same, it returns 0, if it is less than, it returns -1, if it is greater, it returns 1
InStrInStr(string1,string2[, compare]) returns the position of the first occurrence of string1 in string2.
SplitSplit(string1,delimiter[, count[, start]])
Split the string into a one-dimensional array based on delimiter, where delimiter is used to identify substring boundaries. If omitted, a space ("") is used as the delimiter.
count The number of substrings returned, -1 indicates all substrings are returned.
If start is 1, a text comparison is performed; if it is 0 or omitted, a binary comparison is performed.
ReplaceReplace(expression, find, replacewith[, compare[, count[, start]]]) returns a string in which a specified number of substrings (find) are replaced with another substring (replacewith).