Visual Basic Strings

s2 = left(s1, n)returns the left n characters of string s1
s2 = right(s1, n)returns the right n characters of string s1
s2 = mid(s1, n, m)returns the m characters of string s1 starting with position n
n = len(s1)returns length of string s1 in characters
s3 = s1 & s2use the ampersand to concatenate strings
n = InStr(s1, s2)returns first position s2 is found in s1
returns 0 (zero) if s2 is not found
n = InStrRev(s1, s2)returns last position s2 is found in s1
returns 0 (zero) if s2 is not found
s2 = Ucase(s1)returns s1 with all lower case characters replaced with the upper case version
s2 = Lcase(s1)returns s1 with all upper case characters replaced with the lower case version
s2 = StrConv(s1)returns s1 after performing the specified case conversion. Options are:
vbProperCaseConverts the first letter of every word in string to uppercase
vbUpperCaseConverts the string to uppercase characters
vbLowerCaseConverts the string to lowercase characters
list = Split(s1, delim)returns a list containing the pieces of s1 delimited by character delim
list is of type variant
s1 = str(num) or
s1 = str$(num)
convert the number to the string representation
s1 = Hex$(num)convert the number to the string representation in hexidecimal
s2 = Ltrim(s1)removes spaces on left end of s1
s2 = Rtrim(s1)removes spaces on right end of s1
s2 = Trim(s1)removes spaces on both ends of s1
s1 = space(n)fills s1 with n space characters
s1 = String(n, c)fills s1 with n characters c
n = Asc(s1)returns the ASCII value of the first character of s1
s1 = Chr(n)returns character corresponding to the ASCII value n
s2 = StrReverse(s1)returns the sequence of characters in s1 in reverse order
See also - OfficeComputerTraining.com