Commit 50efd323 by Alex-Code

Update BaseStringHelper.php

Updated to use mb_* functions
parent bad1fd80
...@@ -97,8 +97,8 @@ class BaseStringHelper ...@@ -97,8 +97,8 @@ class BaseStringHelper
*/ */
public static function truncate($string, $length, $suffix = '...') public static function truncate($string, $length, $suffix = '...')
{ {
if (strlen($string) > $length) { if (mb_strlen($string) > $length) {
return substr($string, 0, $length) . $suffix; return trim(mb_substr($string, 0, $length)) . $suffix;
} else { } else {
return $string; 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