Truncate
  • 19 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Truncate

  • Dark
    Light
  • 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
ParameterDescription
TextText
Max lengthMax length
EllipsisEllipsis character (default is "…")

Examples

FormulaReturn 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?

What's Next