| @@ 3897-3908 (lines=12) @@ | ||
| 3894 | * |
|
| 3895 | * @return string The string with unwanted characters stripped from the left |
|
| 3896 | */ |
|
| 3897 | public static function ltrim($str = '', $chars = INF) |
|
| 3898 | { |
|
| 3899 | $str = (string)$str; |
|
| 3900 | ||
| 3901 | if (!isset($str[0])) { |
|
| 3902 | return ''; |
|
| 3903 | } |
|
| 3904 | ||
| 3905 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 3906 | ||
| 3907 | return preg_replace("/^{$chars}+/u", '', $str); |
|
| 3908 | } |
|
| 3909 | ||
| 3910 | /** |
|
| 3911 | * Returns the UTF-8 character with the maximum code point in the given data. |
|
| @@ 4377-4388 (lines=12) @@ | ||
| 4374 | * |
|
| 4375 | * @return string The string with unwanted characters stripped from the right |
|
| 4376 | */ |
|
| 4377 | public static function rtrim($str = '', $chars = INF) |
|
| 4378 | { |
|
| 4379 | $str = (string)$str; |
|
| 4380 | ||
| 4381 | if (!isset($str[0])) { |
|
| 4382 | return ''; |
|
| 4383 | } |
|
| 4384 | ||
| 4385 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 4386 | ||
| 4387 | return preg_replace("/{$chars}+$/u", '', $str); |
|
| 4388 | } |
|
| 4389 | ||
| 4390 | /** |
|
| 4391 | * rxClass |
|