Namespace
The input string.
The maximum length of the truncated string.
The truncated string.
const originalString = "hello, world!";
const truncatedString = StringUtils.truncateString(originalString, 5);
console.log(truncatedString); // Output: "hello..."
Generated using TypeDoc
StringUtils
Truncate a string to a specified maximum length and append an ellipsis if needed.