|
|
|
@ -16,7 +16,7 @@ final class MbstringExtended {
|
|
|
|
|
*/
|
|
|
|
|
public static function trim (string $string, string $charactersPattern = '\\s'): string {
|
|
|
|
|
/** @noinspection RegExpUnnecessaryNonCapturingGroup */
|
|
|
|
|
return preg_replace('#(?:^' . $charactersPattern . ')|(?:' . $charactersPattern . '$)#u', '', $string);
|
|
|
|
|
return preg_replace('#^(?:' . $charactersPattern . ')+|(?:' . $charactersPattern . ')+$#u', '', $string);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Multi-bytes implementation for {@see https://www.php.net/manual/function.ucfirst.php ucfirst}
|
|
|
|
|