TRUNCATE
Returns the string truncated to the specified number of characters, with an ellipsis added at the end if truncation occurred.
Syntax
=TRUNCATE(string, length)
Arguments
Argument | Type | Description |
---|---|---|
string | String | The string to truncate |
length | Number | Desired length |
Examples
=TRUNCATE("A VERY LONG TEXT", 9)
→"A VERY LO…"
The text is truncated to the specified number of characters with '…' added at the end
=TRUNCATE("MEDIUM", 7)
→"MEDIUM"
The text is not truncated because the original length is less than the desired length
=TRUNCATE("TEXT", 4)
→"TEXT"
If the desired length is the same as the original length the text is not truncated
Updated 7 months ago