These built-in functions create strings. Methods for parsing, trimming, searching, and converting strings are documented under Built-in methods.
Returns an empty string.
| Argument | Type | Description |
|---|---|---|
| none | No arguments. |
Returns: string.
Example:
text = str(); // ''
Converts a value to string form.
| Argument | Type | Description |
|---|---|---|
| `value` | any | Value to convert. |
Returns: string.
Example:
str(123); // '123' str(none()); // string form of none
Repeats a pattern string.
| Argument | Type | Description |
|---|---|---|
| `count` | number | Number of repetitions. Negative values behave like zero. |
| `pattern` | any | Pattern converted to string and repeated. |
Returns: string.
Example:
str(3, 'ab'); // 'ababab' str(5, '-'); // '-----'
Creates a random string.
| Argument | Type | Description |
|---|---|---|
| `length` | number | Requested string length. |
Returns: string.
Example:
token = str_rand(16);
Creates a string of spaces.
| Argument | Type | Description |
|---|---|---|
| `count` | number | Number of spaces. Negative values behave like zero. |
Returns: string.
Example:
indent = str_spaces(4); text = indent + 'line';
Creates a UUID string.
| Argument | Type | Description |
|---|---|---|
| none | No arguments. |
Returns: string.
Example:
id = str_uuid();
Previous: Rounding and Centering