The string to shorten.
The maximum length of the result, including the separator.
Optionalseparator: string = '…'
The text that replaces the removed characters.
The input if it fits within maxLength, otherwise the shortened string. An empty string if no input is given.
Shortens a string to a maximum length by replacing its middle with a separator, keeping the start and the end.