|
@@ 1675-1681 (lines=7) @@
|
| 1672 |
|
* |
| 1673 |
|
* @return Stringy Object whose $str has had tabs switched to spaces |
| 1674 |
|
*/ |
| 1675 |
|
public function toSpaces($tabLength = 4) |
| 1676 |
|
{ |
| 1677 |
|
$spaces = UTF8::str_repeat(' ', $tabLength); |
| 1678 |
|
$str = UTF8::str_replace("\t", $spaces, $this->str); |
| 1679 |
|
|
| 1680 |
|
return static::create($str, $this->encoding); |
| 1681 |
|
} |
| 1682 |
|
|
| 1683 |
|
/** |
| 1684 |
|
* Converts each occurrence of some consecutive number of spaces, as |
|
@@ 1692-1698 (lines=7) @@
|
| 1689 |
|
* |
| 1690 |
|
* @return Stringy Object whose $str has had spaces switched to tabs |
| 1691 |
|
*/ |
| 1692 |
|
public function toTabs($tabLength = 4) |
| 1693 |
|
{ |
| 1694 |
|
$spaces = UTF8::str_repeat(' ', $tabLength); |
| 1695 |
|
$str = UTF8::str_replace($spaces, "\t", $this->str); |
| 1696 |
|
|
| 1697 |
|
return static::create($str, $this->encoding); |
| 1698 |
|
} |
| 1699 |
|
|
| 1700 |
|
/** |
| 1701 |
|
* Converts the first character of each word in the string to uppercase. |