Strings can be stored in variables of string
and variant
. When using variant
strings, be aware of type coercion in
CitectVBA. Strings can be compared with each other in CitectVBA to
determine whether they contain the same characters or not. Strings
can be joined together to create longer strings in CitectVBA using
the concatenation operator.
Strings can be searched using the:
InStr()
function, which returns the
character position of the first occurrence of a string within
another;Left()
function or Right()
function which
return a copy of the left or right most characters of a string
respectively; andMid()
function, which returns the copy of a
substring from within another string.To determine the length of a string, use the
Len()
function which returns a Long variable containing the number of
characters in the string.
String characters can be converted to ASCII values
using the Asc()
function, and ASCII values can be
converted to their string characters using the Chr()
Function.
String characters can be converted to all
lowercase or all uppercase using the Lcase()
Function or
the
Function respectively.Ucase()
Leading or trailing spaces can be stripped off
strings using the Ltrim()
function or the Rtrim()
function
respectively.
Strings can be created consisting of a specified
number of spaces or characters using the Space()
function or
the String()
function respectively.
For syntax details of using string functions, see String Functions.
See Also