The string to truncate.
The maximum length of the truncated string (excluding the suffix).
The string to append to the truncated string (default is "...").
The truncated string with the suffix if truncation occurred, otherwise returns the original string.
Truncates a string to a specified length and adds an ellipsis. A must-have for UI-focused utility libraries.