Operator (+)

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > Operators > String >

Operator (+)

 

Description

 

Used to concatenate two strings.

 

Syntax

 

result = expression1 + expression2

 

The + operator syntax has these parts:

 

PartDescription
resultAny string variable.
expression1Any expression (string or numeric).
expression2Any expression (string or numeric).

 

Returns

 

N/A

 

Remarks

 

Although you can also use the + operator to concatenate two character strings, you should use the & operator for concatenation to eliminate ambiguity and provide self-documenting code.

 

Restrictions

 

See also

 

Examples

 

DIM MyString AS STRING

 

'Results will be the string '123'

MyString = 1 + 2 + 3

MyString = 1 & 2 & 3