|
@@ 1441-1450 (lines=10) @@
|
| 1438 |
|
* |
| 1439 |
|
* @return static Object with the resulting $str after the replacements |
| 1440 |
|
*/ |
| 1441 |
|
public function replace($search, $replacement, $caseSensitive = true) |
| 1442 |
|
{ |
| 1443 |
|
if ($caseSensitive) { |
| 1444 |
|
$return = UTF8::str_replace($search, $replacement, $this->str); |
| 1445 |
|
} else { |
| 1446 |
|
$return = UTF8::str_ireplace($search, $replacement, $this->str); |
| 1447 |
|
} |
| 1448 |
|
|
| 1449 |
|
return static::create($return); |
| 1450 |
|
} |
| 1451 |
|
|
| 1452 |
|
/** |
| 1453 |
|
* Replaces all occurrences of $search in $str by $replacement. |
|
@@ 1461-1470 (lines=10) @@
|
| 1458 |
|
* |
| 1459 |
|
* @return static Object with the resulting $str after the replacements |
| 1460 |
|
*/ |
| 1461 |
|
public function replaceAll(array $search, $replacement, $caseSensitive = true) |
| 1462 |
|
{ |
| 1463 |
|
if ($caseSensitive) { |
| 1464 |
|
$return = UTF8::str_replace($search, $replacement, $this->str); |
| 1465 |
|
} else { |
| 1466 |
|
$return = UTF8::str_ireplace($search, $replacement, $this->str); |
| 1467 |
|
} |
| 1468 |
|
|
| 1469 |
|
return static::create($return); |
| 1470 |
|
} |
| 1471 |
|
|
| 1472 |
|
/** |
| 1473 |
|
* Replaces all occurrences of $search from the beginning of string with $replacement |