Office Accelerator® Support

String Functions

LEFT StringVarOut, StringVarIn, Length

StringVarOut = the left most Length characters of StringVarIn. If Length <= 0, then "".

RIGHT StringVarOut, StringIn, Length

StringVarOut = the right most Length characters of StringIn. If Length <= 0, then "". If Length greater than the string length, then the full string is returned.

SUBSTRING StringVarOut, StringIn, Position, Length

StringVarOut = the first Length characters of StringIn, starting at character Position. Note: less than Length characters may be returned by this function. Position is zero-based. If Length < 0 then it returns to the end of the string. If Length = 0 or Position < 0 or Position > len(StringIn) then "".

LENGTH ValOut, StringIn

ValOut = the length of StringIn

CONTAINS ValOut, StringIn, CheckString

ValOut = the zero-based position of CheckString within StringIn (case sensitive). If no match is found, ValOut = -1.

CONTAINSI ValOut, StringIn, CheckString

ValOut = the zero-based position of CheckString within StringIn (case insensitive). If no match is found, ValOut = -1.

STARTSWITH ValOut, StringIn, CheckString

ValOut = 0 if StringIn starts with CheckString (case sensitive). If no match is found, ValOut = -1.

STARTSWITHI ValOut, StringIn, CheckString

ValOut = 0 if StringIn starts with CheckString (case insensitive). If no match is found, ValOut = -1.

ENDSWITH ValOut, StringIn, CheckString

ValOut = the zero-based position of StringIn ends with CheckString (case sensitive). If no match is found, ValOut = -1.

ENDSWITHI ValOut, StringIn, CheckString

ValOut = the zero-based position of StringIn ends with CheckString (case insensitive). If no match is found, ValOut = -1.

TOUPPER StringVarOut, StringIn

StringVarOut = StringIn converted to upper case.

TOLOWER StringVarOut, StringIn

StringVarOut = StringIn converted to lower case.

TOPROPER StringVarOut, StringIn

StringVarOut = StringIn converted to: first character of each word in StringIn is Upper Case, all other characters are Lower Case.

CHR StringVarOut, AnsiIn , Repeat

StringVarOut = the ANSI character AnsiIn, repeated Repeat times. Repeat <= 0 is interpreted as 1.

ANSI AnsiOut, StringIn

AnsiOut = the ANSI value of the first character of StringIn. If StringIn="", then 0.

TRIM StringVarOut, StringIn

StringVarOut = StringIn with all leading and trailing white space removed.

LTRIM StringVarOut, StringIn

StringVarOut = StringIn with all leading white space removed.

RTRIM StringVarOut, StringIn

StringVarOut = StringIn with all trailing white space removed.