@@ 1530-1539 (lines=10) @@ | ||
1527 | * |
|
1528 | * @return static <p>Object with the resulting $str after the replacements.</p> |
|
1529 | */ |
|
1530 | public function replace($search, $replacement, $caseSensitive = true) |
|
1531 | { |
|
1532 | if ($caseSensitive) { |
|
1533 | $return = UTF8::str_replace($search, $replacement, $this->str); |
|
1534 | } else { |
|
1535 | $return = UTF8::str_ireplace($search, $replacement, $this->str); |
|
1536 | } |
|
1537 | ||
1538 | return static::create($return); |
|
1539 | } |
|
1540 | ||
1541 | /** |
|
1542 | * Replaces all occurrences of $search in $str by $replacement. |
|
@@ 1550-1559 (lines=10) @@ | ||
1547 | * |
|
1548 | * @return static <p>Object with the resulting $str after the replacements.</p> |
|
1549 | */ |
|
1550 | public function replaceAll(array $search, $replacement, $caseSensitive = true) |
|
1551 | { |
|
1552 | if ($caseSensitive) { |
|
1553 | $return = UTF8::str_replace($search, $replacement, $this->str); |
|
1554 | } else { |
|
1555 | $return = UTF8::str_ireplace($search, $replacement, $this->str); |
|
1556 | } |
|
1557 | ||
1558 | return static::create($return); |
|
1559 | } |
|
1560 | ||
1561 | /** |
|
1562 | * Replaces all occurrences of $search from the beginning of string with $replacement. |