Visual Basic Functions

Math Functions
Sqr(val) Square root
Abs(val) Absolute value
Sgn(val) Sign
Fix(val) Integer part
Exp(val) Exponential (natural)
Log(val) Natural logarithm
Rnd( ) Random number (0-1)
     
Logical Functions
IsNumeric("string") Check for a valid number
Iff(test, if-true, if-false) Immediate if

String Functions
Val("string") Convert string to double
Str$(val) Convert number to string
Format$(val) Convert with formatting
Left$("string", pos) Substring from left end
Right$("string", pos) Substring from right end
Mid$("string",pos,count) Substring from interior
LCase$("string") Convert to lowercase
UCase$("string") Convert to uppercase
LTrim$(" string ") Trim spaces off left
RTrim$(" string ") Trim spaces off right
Trim$(" string ") Trim spaces off both
Len("string") Length of string
String$(count, "ch") Repeat character
InStr("str1", "str2") Substring search
Asc("ch") Convert char to ANSI code
Chr$(val) Convert ANSI code to char
   
ToString( )
"a" thousands separator
"f" fixed
"e" exponent
"C" currency
"P" percent
"d" date
"D" date
"t" time
"T" Time
"F" full