Len(string) - returns the (a number) that is the length of string
UCase(string) - returns string in all uppercase letters
LCase(string) - returns string in all lowercase letters
String(length,char) - returns a string with length number of the character char
Left(string,length) - returns the leftmost length (# of characters) of the string
Right(string,length) - returns the rightmost length of the string
Mid(string,start[,length]) - returns length # of characters of the string beginning at position start. If length is omitted, the function returns all characters from the start position through the end of the string
Instr(start,string1,string2[,compare]) - determines if string2 is contained within string1 starting from position start. If so, returns the position where string2 begins. If string2 is not there, returns 0. If compare is omitted or if it is 0, a case-sensitive search (the default is 0) is performed. If compare is a 1, then a case-insensitive search is performed.
Asc(character) - returns the ASCII code for the character
Chr(number) - returns the character matching the number (ASCII) code
Val(string) - returns the numeric equivalent of string, if a non-numeric character is contained in the string then Val returns a number up to that character. See example below.
Str(number) - returns the string equivalent of number (cannot calculate with this string)
Examples: Assume that varName is declared as a string and contains “Visual Basic”
Function - Results/Output
UCase(“Hello”) - HELLO
LCase(varName) - visual basic
String(5, “A”) - AAAAA
Len(varName) - 12
Len(“hello”) - 5
Left(“January”,3) - Jan
Right(“January”,2) - ry
Left(varName,6) - Visual
Right(varName,5) - Basic
Mid(“January”,2,1) - a
Mid(“January”,4,2) - ua
Mid(varName,8,1) - B
Mid(varName,8) - Basic
Instr(1, “Have a nice day”, “nice”,0) - 8
Instr(1, “Have a nice day”, “Nice”) - 0
Instr(9, “This is an Instr function example”, “instr”) - 0
Instr(9, “This is an Instr function example”, “instr”,1) - 12
Asc(“B”) - 66
Chr(33) - !
Val(“0050”) - 50
Val(“354.6AB5”) - 354.6
Str(450.1) - “450.1”
No comments:
Post a Comment