| @@ 3642-3653 (lines=12) @@ | ||
| 3639 | * |
|
| 3640 | * @return string The string with unwanted characters stripped from the left |
|
| 3641 | */ |
|
| 3642 | public static function ltrim($str = '', $chars = INF) |
|
| 3643 | { |
|
| 3644 | $str = (string)$str; |
|
| 3645 | ||
| 3646 | if (!isset($str[0])) { |
|
| 3647 | return ''; |
|
| 3648 | } |
|
| 3649 | ||
| 3650 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 3651 | ||
| 3652 | return preg_replace("/^{$chars}+/u", '', $str); |
|
| 3653 | } |
|
| 3654 | ||
| 3655 | /** |
|
| 3656 | * Returns the UTF-8 character with the maximum code point in the given data. |
|
| @@ 4106-4117 (lines=12) @@ | ||
| 4103 | * |
|
| 4104 | * @return string The string with unwanted characters stripped from the right |
|
| 4105 | */ |
|
| 4106 | public static function rtrim($str = '', $chars = INF) |
|
| 4107 | { |
|
| 4108 | $str = (string)$str; |
|
| 4109 | ||
| 4110 | if (!isset($str[0])) { |
|
| 4111 | return ''; |
|
| 4112 | } |
|
| 4113 | ||
| 4114 | $chars = INF === $chars ? '\s' : self::rxClass($chars); |
|
| 4115 | ||
| 4116 | return preg_replace("/{$chars}+$/u", '', $str); |
|
| 4117 | } |
|
| 4118 | ||
| 4119 | /** |
|
| 4120 | * rxClass |
|