- Preparing search index...
- The search index is not available
@giraugh/tools
Function truncateWithEllipsis
- truncateWithEllipsis(string, maxLength?, ellipsis?): string
-
Parameters
-
string: string
-
maxLength: number = 50
-
ellipsis: string = '…'
Returns string
Truncate a string if its too long, adding an ellipsis if truncation occurs
Note
the ellipsis should be shorter than the maxlength for proper results
Returns
the truncated string with length <=
maxLength
Example
Example
Example