@@ 700-713 (lines=14) @@ | ||
697 | * |
|
698 | * @return Stringy Object with the first character of $str being upper case |
|
699 | */ |
|
700 | public function upperCaseFirst() |
|
701 | { |
|
702 | $first = UTF8::substr($this->str, 0, 1, $this->encoding); |
|
703 | $rest = UTF8::substr( |
|
704 | $this->str, |
|
705 | 1, |
|
706 | $this->length() - 1, |
|
707 | $this->encoding |
|
708 | ); |
|
709 | ||
710 | $str = UTF8::strtoupper($first, $this->encoding) . $rest; |
|
711 | ||
712 | return static::create($str, $this->encoding); |
|
713 | } |
|
714 | ||
715 | /** |
|
716 | * Returns the index of the last occurrence of $needle in the string, |
|
@@ 2173-2184 (lines=12) @@ | ||
2170 | * |
|
2171 | * @return Stringy Object with the first character of $str being lower case |
|
2172 | */ |
|
2173 | public function lowerCaseFirst() |
|
2174 | { |
|
2175 | $first = UTF8::substr($this->str, 0, 1, $this->encoding); |
|
2176 | $rest = UTF8::substr($this->str, 1, $this->length() - 1, $this->encoding); |
|
2177 | ||
2178 | $str = UTF8::strtolower($first, $this->encoding) . $rest; |
|
2179 | ||
2180 | return static::create($str, $this->encoding); |
|
2181 | } |
|
2182 | ||
2183 | /** |
|
2184 | * Shorten the string after $length, but also after the next word. |
|
2185 | * |
|
2186 | * @param int $length |
|
2187 | * @param string $strAddOn |