# String expressions

A string expression is any expression that evaluates to,
or can be converted to a string of characters.

A string expression can be a string constant, a numeric
constant, a variable with a string or numeric value, a substring,
a concatenation of string expressions, an intrinsic function, or a
format mask.

Concatenation of strings is specified by a `:` or by the `cat` operator. The `cat` operator must be preceded and followed by spaces.

The result
of a string expression is an ASCII character string.

String
expressions can include arithmetic expressions. The results of any
numeric function or arithmetic expression is converted to an equivalent
ASCII string.

## Example(s)

The string expression consists
of the literal string, `"the total amount is "`, followed
by the contents of the variable amount.

```
print "the total amount is " : amount
```
The results of the arithmetic expression `unit.price * quantity` is converted to ASCII and concatenated to the
literal string.

```
line = "the total amount is " : unit.price * quantity
```
In this example, `name` is a string expression.

```
name = "Rocket"
```

## See also

- [: relational operator](https://d3codex.com/pickbasic-flashbasic/colon-relational-operator/)
- [Arithmetic expressions](https://d3codex.com/pickbasic-flashbasic/arithmetic-expressions/)
- [cat relational operator](https://d3codex.com/pickbasic-flashbasic/cat-relational-operator/)
- [count() function](https://d3codex.com/pickbasic-flashbasic/count-function/)
- [Expression](https://d3codex.com/definitions/expression/)
- [insert() function](https://d3codex.com/pickbasic-flashbasic/insert-function/)
- [Logical expressions](https://d3codex.com/pickbasic-flashbasic/logical-expressions/)
- [\ arithmetic operator](https://d3codex.com/pickbasic-flashbasic/backslash-arithmetic-operator/)

---
Source: https://d3codex.com/pickbasic-flashbasic/string-expressions/ - part of the D3Codex reference.
