public static Unicode::truncate($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1)
Truncates a UTF-8-encoded string safely to a number of characters.
Parameters
string $string: The string to truncate.
int $max_length: An upper limit on the returned string length, including trailing ellipsis if $add_ellipsis is TRUE.
bool $wordsafe: If TRUE, attempt to truncate on a word boundary. Word boundaries are spaces, punctuation, and Unicode characters used as word