@@ 1645-1651 (lines=7) @@ | ||
1642 | * |
|
1643 | * @return Stringy Object whose $str has had tabs switched to spaces |
|
1644 | */ |
|
1645 | public function toSpaces($tabLength = 4) |
|
1646 | { |
|
1647 | $spaces = UTF8::str_repeat(' ', $tabLength); |
|
1648 | $str = UTF8::str_replace("\t", $spaces, $this->str); |
|
1649 | ||
1650 | return static::create($str, $this->encoding); |
|
1651 | } |
|
1652 | ||
1653 | /** |
|
1654 | * Converts each occurrence of some consecutive number of spaces, as |
|
@@ 1662-1668 (lines=7) @@ | ||
1659 | * |
|
1660 | * @return Stringy Object whose $str has had spaces switched to tabs |
|
1661 | */ |
|
1662 | public function toTabs($tabLength = 4) |
|
1663 | { |
|
1664 | $spaces = UTF8::str_repeat(' ', $tabLength); |
|
1665 | $str = UTF8::str_replace($spaces, "\t", $this->str); |
|
1666 | ||
1667 | return static::create($str, $this->encoding); |
|
1668 | } |
|
1669 | ||
1670 | /** |
|
1671 | * Converts the first character of each word in the string to uppercase. |