This function truncates a string if necessary to make it fit within the supplied max length.
If truncation occurs then this is indicated by a having the specified indicator string appended to to the end of the truncated string. The truncation is performed such that the final string, including the truncation indicator, fits withing the specified max length.
The default truncation indicator is the ellipsis character ('…').
The processed string.