Commit 50efd323 by Alex-Code

Update BaseStringHelper.php

Updated to use mb_* functions
parent bad1fd80
......@@ -97,8 +97,8 @@ class BaseStringHelper
*/
public static function truncate($string, $length, $suffix = '...')
{
if (strlen($string) > $length) {
return substr($string, 0, $length) . $suffix;
if (mb_strlen($string) > $length) {
return trim(mb_substr($string, 0, $length)) . $suffix;
} else {
return $string;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment