| @@ 3683-3694 (lines=12) @@ | ||
| 3680 | * |
|
| 3681 | * @return string The string with unwanted characters stripped from the left |
|
| 3682 | */ |
|
| 3683 | public static function ltrim($str = '', $chars = INF) |
|
| 3684 | { |
|
| 3685 | $str = (string)$str; |
|
| 3686 | ||
| 3687 | if (!isset($str[0])) { |
|
| 3688 | return ''; |
|
| 3689 | } |
|
| 3690 | ||
| 3691 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 3692 | ||
| 3693 | return preg_replace("/^{$chars}+/u", '', $str); |
|
| 3694 | } |
|
| 3695 | ||
| 3696 | /** |
|
| 3697 | * Returns the UTF-8 character with the maximum code point in the given data. |
|
| @@ 4142-4153 (lines=12) @@ | ||
| 4139 | * |
|
| 4140 | * @return string The string with unwanted characters stripped from the right |
|
| 4141 | */ |
|
| 4142 | public static function rtrim($str = '', $chars = INF) |
|
| 4143 | { |
|
| 4144 | $str = (string)$str; |
|
| 4145 | ||
| 4146 | if (!isset($str[0])) { |
|
| 4147 | return ''; |
|
| 4148 | } |
|
| 4149 | ||
| 4150 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 4151 | ||
| 4152 | return preg_replace("/{$chars}+$/u", '', $str); |
|
| 4153 | } |
|
| 4154 | ||
| 4155 | /** |
|
| 4156 | * rxClass |
|