Data type Character string Foundation

Values of the "character" data type consist of one or more ASCII characters. A literal character or a character string constant is defined using one of three pairs of delimiting characters. The single quotation marks 'ABC', the double quotation marks "ABC" and the brackets [ABC] can be used as delimiting characters. The delimiting characters may not be mixed, but within a character string other delimiting characters may appear. The following character strings are valid:

'Hello world' 
"Let's go" 
[He said, "Let's go"] 

If there are not enough delimiting characters, character strings with different delimiting characters can be concatenated using the plus operator (see the chapter "Operations and operators for Simple Data Types").

"The limiting characters are:" + '" ", ' + "' ' and " + '[ ]' 

The length of a character string is not limited in Xbase++. An empty character string is defined by two delimiting characters with no other characters between, such as "", '' or []. Empty character strings are usually called a null string, which is not to be confused with the ASCII character 0. The ASCII character 0 is a valid character.

Although brackets may be used as delimiting characters, they should not be used in defining character strings, if it is possible to avoid them. Brackets must be used to define the elements in an array and using brackets in both situations reduces the readability of program code.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.