CitectVBA Programming Reference > Understanding CitectVBA Language Basics > Strings > String Concatenation

String Concatenation

To concatenate strings in CitectVBA, use the ampersand ( & ) concatenation operator between the strings. Multiple concatenations can occur in the same CitectVBA statement.

Dim strFirstName As String
Dim strLastName As String
Dim strFullName As String
Const strSpaceChar = " "
' note the space character between the quotes
strFirstName = "Colin"
strLastName = "Ramsden"
strFullName = strFirstName &strSpaceChar &strLastName
' concatenates string values

The & concatenation operator does not perform arithmetic, and will convert variable data types to strings for concatenation. For instance, if a variant string and a variant number are concatenated, the result is a string. For more details of variant data types, see Variant Declaration and CitectVBA Data Types.

See Also