| @@ 3829-3840 (lines=12) @@ | ||
| 3826 | * |
|
| 3827 | * @return string The string with unwanted characters stripped from the left |
|
| 3828 | */ |
|
| 3829 | public static function ltrim($str = '', $chars = INF) |
|
| 3830 | { |
|
| 3831 | $str = (string)$str; |
|
| 3832 | ||
| 3833 | if (!isset($str[0])) { |
|
| 3834 | return ''; |
|
| 3835 | } |
|
| 3836 | ||
| 3837 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 3838 | ||
| 3839 | return preg_replace("/^{$chars}+/u", '', $str); |
|
| 3840 | } |
|
| 3841 | ||
| 3842 | /** |
|
| 3843 | * Returns the UTF-8 character with the maximum code point in the given data. |
|
| @@ 4297-4308 (lines=12) @@ | ||
| 4294 | * |
|
| 4295 | * @return string The string with unwanted characters stripped from the right |
|
| 4296 | */ |
|
| 4297 | public static function rtrim($str = '', $chars = INF) |
|
| 4298 | { |
|
| 4299 | $str = (string)$str; |
|
| 4300 | ||
| 4301 | if (!isset($str[0])) { |
|
| 4302 | return ''; |
|
| 4303 | } |
|
| 4304 | ||
| 4305 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 4306 | ||
| 4307 | return preg_replace("/{$chars}+$/u", '', $str); |
|
| 4308 | } |
|
| 4309 | ||
| 4310 | /** |
|
| 4311 | * rxClass |
|