| @@ 3708-3719 (lines=12) @@ | ||
| 3705 | * |
|
| 3706 | * @return string The string with unwanted characters stripped from the left |
|
| 3707 | */ |
|
| 3708 | public static function ltrim($str = '', $chars = INF) |
|
| 3709 | { |
|
| 3710 | $str = (string)$str; |
|
| 3711 | ||
| 3712 | if (!isset($str[0])) { |
|
| 3713 | return ''; |
|
| 3714 | } |
|
| 3715 | ||
| 3716 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 3717 | ||
| 3718 | return preg_replace("/^{$chars}+/u", '', $str); |
|
| 3719 | } |
|
| 3720 | ||
| 3721 | /** |
|
| 3722 | * Returns the UTF-8 character with the maximum code point in the given data. |
|
| @@ 4177-4188 (lines=12) @@ | ||
| 4174 | * |
|
| 4175 | * @return string The string with unwanted characters stripped from the right |
|
| 4176 | */ |
|
| 4177 | public static function rtrim($str = '', $chars = INF) |
|
| 4178 | { |
|
| 4179 | $str = (string)$str; |
|
| 4180 | ||
| 4181 | if (!isset($str[0])) { |
|
| 4182 | return ''; |
|
| 4183 | } |
|
| 4184 | ||
| 4185 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 4186 | ||
| 4187 | return preg_replace("/{$chars}+$/u", '', $str); |
|
| 4188 | } |
|
| 4189 | ||
| 4190 | /** |
|
| 4191 | * rxClass |
|