Trim a string to a certain length with an ellipsis
function trimString(str: string, maxLength: number)
str:string
The string to trim.
maxLength:number
The maximum number of characters.
The trimmed string.
import { trimString } from '@deskpro/js-utils/dist/strings';
console.log(trimString('abcdefg', 6)); // Outputs abc...
console.log(trimString('abcde', 6)); // Outputs abcde