Description
The length function returns the length of the provided string. This includes all characters within the string, including spaces, special characters, and numbers.
Note: Cannot be persisted using persist.
Syntax
length(string)
Arguments
| Argument | Description |
|---|---|
string |
The string whose length is to be determined. |
Return Types
The function returns an integer representing the number of characters in the string.
Examples
| Description | Formula | Result |
|---|---|---|
| Length of a simple text |
length("Smenso")
|
Returns 6 |
| Length of a sentence |
length("Hello World!")
|
Returns 11 (including spaces and exclamation mark) |
| Usage with an empty string |
length("")
|
Returns 0 |
Notes
- Spaces and special characters: All characters, including spaces and special characters, are counted towards the length.
- Empty string: If an empty string (
"") is passed, the function returns0.
Comments
0 comments
Please sign in to leave a comment.