@@ 101-107 (lines=7) @@ | ||
98 | * @param string|null $encoding The encoding to use. |
|
99 | * @return string The converted string. |
|
100 | */ |
|
101 | public static function lowerFirst(string $str, string $encoding = null) : string |
|
102 | { |
|
103 | $encoding = $encoding ?: utils\Str::encoding($str); |
|
104 | ||
105 | // Lowercase the first character and append the remainder. |
|
106 | return mb_strtolower(mb_substr($str, 0, 1, $encoding), $encoding) . mb_substr($str, 1, null, $encoding); |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * Converts the string to "snake_case" using whitespace, dashes and underscores as case delimiters (all of |
|
@@ 178-184 (lines=7) @@ | ||
175 | * @param string|null $encoding The encoding to use. |
|
176 | * @return string The converted string. |
|
177 | */ |
|
178 | public static function upperFirst(string $str, string $encoding = null) : string |
|
179 | { |
|
180 | $encoding = $encoding ?: utils\Str::encoding($str); |
|
181 | ||
182 | // Uppercase the first character and append the remainder. |
|
183 | return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding) . mb_substr($str, 1, null, $encoding); |
|
184 | } |
|
185 | } |
|
186 |