truncate 
Truncates a long string to a specified length, optionally appending an ellipsis after the string.
Parameters
str::stringlength::numberellipsis::string || ''
Named
Returns
string
Examples
javascript
truncate('hello', 3); // Returns 'hel'
truncate('hello', 2, '...'); // Returns 'he...'dart
truncate('hello', 3); // Returns 'hel'
truncate('hello', 2, ellipsis: '...'); // Returns 'he...'