| @@ 3755-3766 (lines=12) @@ | ||
| 3752 | * |
|
| 3753 | * @return string The string with unwanted characters stripped from the left |
|
| 3754 | */ |
|
| 3755 | public static function ltrim($str = '', $chars = INF) |
|
| 3756 | { |
|
| 3757 | $str = (string)$str; |
|
| 3758 | ||
| 3759 | if (!isset($str[0])) { |
|
| 3760 | return ''; |
|
| 3761 | } |
|
| 3762 | ||
| 3763 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 3764 | ||
| 3765 | return preg_replace("/^{$chars}+/u", '', $str); |
|
| 3766 | } |
|
| 3767 | ||
| 3768 | /** |
|
| 3769 | * Returns the UTF-8 character with the maximum code point in the given data. |
|
| @@ 4232-4243 (lines=12) @@ | ||
| 4229 | * |
|
| 4230 | * @return string The string with unwanted characters stripped from the right |
|
| 4231 | */ |
|
| 4232 | public static function rtrim($str = '', $chars = INF) |
|
| 4233 | { |
|
| 4234 | $str = (string)$str; |
|
| 4235 | ||
| 4236 | if (!isset($str[0])) { |
|
| 4237 | return ''; |
|
| 4238 | } |
|
| 4239 | ||
| 4240 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 4241 | ||
| 4242 | return preg_replace("/{$chars}+$/u", '', $str); |
|
| 4243 | } |
|
| 4244 | ||
| 4245 | /** |
|
| 4246 | * rxClass |
|