Truncate
- 19 May 2022
- 1 Minute to read
- DarkLight
- PDF
Truncate
- Updated on 19 May 2022
- 1 Minute to read
- DarkLight
- PDF
Article Summary
If the given text is longer than the given length parameter, it is shortened and appended with an ellipsis character, so that the resultant text length is always less or equal than the given length parameter. Returns the truncated text.
Function signature
TRUNCATE(text: String, maxlength: Number, ellipsis: String = …) => String
Parameter | Description |
---|---|
Text | Text |
Max length | Max length |
Ellipsis | Ellipsis character (default is "…") |
Examples
Formula | Return value |
---|---|
TRUNCATE("Wissenschaft is a science", 5) | Wiss… |
TRUNCATE("This is a simple text", 4) | Thi… |
TRUNCATE("This is a simple text", 4, "...") | T... |
TRUNCATE("This is a simple text", 4, "") | This |
Was this article helpful?