If the given string is greater than a max length, truncate the string with an indicator. Example: truncate('a very long string', 10) // 'a very ...'
A nullable string.
The string to indicate there was truncation, default is an ellipses … (U+2026)
Returns the truncated string, or the nullish value if str is nullish.
If the given string is greater than a max length, truncate the string with an indicator. Example: truncate('a very long string', 10) // 'a very ...'