Text values


4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3

You specify a text value by enclosing text between single quotes, or between double quotes, for example:

'A', "A25", 'A longish text - with punctuation.'

A text value can contain any character, including any digit, comma, space, and new line. To include a single quote(') or apostrophe, type two single quotes in sequence, such as:

'Isn''t this easy?'

The resulting text contains only one apostrophe. Or you can enclose the text value in double quotes:

"Don't do that!"

Similarly, if you want to include double quotes, enclose the text in single quotes:

'Did you say "Yes"?'

You can enter a text value directly as the value of a variable, or in an expression, including as an element of a list (see Creating an index) or edit table (see Defining a variable as an edit table). Analytica displays text values in results without the enclosing quotes. Also see Converting number to text.

You can embed expressions in a Formatted Text Literal, a.k.a. F-string. A formatted text literal begins with an F or f in front of double-quoted text and embeds expressions in curly braces, such as F"The square root of {x} is {sqrt(x)}.". When the F-string is evaluated, the curly braces and expression get replaced with the result of evaluating the expression. You can also concisely control the formatting of the value. See Formatted Text Literals.

For comparison and sort order for text, see Alphabetic ordering of text values. For functions that work with text values, see Text functions.

For converting between numbers and text, see Numbers and text.

See Also


You are not allowed to post comments.