This section provides a list of commonly used built-in string functions.
VBScript supports the following commonly used string functions:
InStr(sString, sSubString) - Returns the position of the first occurrence of one string within another. The search begins at the first character of the string
InStrRev(sString, sSubString) - Returns the position of the first occurrence of one string within another. The search begins at the last character of the string
LCase(sString) - Converts a specified string to lowercase
Left(sString, iLen) - Returns a specified number of characters from the left side of a string
Len(sString) - Returns the number of characters in a string
LTrim(sString) - Removes spaces on the left side of a string
RTrim(sString) - Removes spaces on the right side of a string
Trim(sString) - Removes spaces on both the left and the right side of a string
Mid(sString, iStart, iLen) - Returns a specified number of characters from a string
Replace(sString, sOld, sNew) - Replaces a specified part of a string with another string a specified number of times
Right(sString, iLen) - Returns a specified number of characters from the right side of a string
Space(iLen) - Returns a string that consists of a specified number of spaces
StrComp(sString1, sString2) - Compares two strings and returns a value that represents the result of the comparison
String(iLen, sChar, iLen) - Returns a string that contains a repeating character of a specified length
StrReverse(sString) - Reverses a string
UCase(sString) - Converts a specified string to uppercase
Asc(sString) - Converts the first letter in a string to ANSI code
Chr(iInteger) - Converts the specified ANSI code to a character