monkey patching vanderlee/php-sentence#/27

This commit is contained in:
Andreas Gohr
2024-07-04 21:02:15 +02:00
parent 8a9be4fb81
commit 5d8f40498f

View File

@ -56,7 +56,9 @@ class Multibyte
*/
public static function trim($string)
{
return mb_ereg_replace('^\s*([\s\S]*?)\s*$', '\1', $string);
$string = mb_ereg_replace('^\s*', '', $string); // left trim
$string = mb_ereg_replace('\s*$', '', $string); // right trim
return $string;
}
/**