@@ 1234-1243 (lines=10) @@ | ||
1231 | * |
|
1232 | * @return Stringy Object with the resulting $str after the replacements |
|
1233 | */ |
|
1234 | public function replace($search, $replacement, $caseSensitive = true) |
|
1235 | { |
|
1236 | if ($caseSensitive) { |
|
1237 | $return = UTF8::str_replace($search, $replacement, $this->str); |
|
1238 | } else { |
|
1239 | $return = UTF8::str_ireplace($search, $replacement, $this->str); |
|
1240 | } |
|
1241 | ||
1242 | return static::create($return); |
|
1243 | } |
|
1244 | ||
1245 | /** |
|
1246 | * Replaces all occurrences of $search in $str by $replacement. |
|
@@ 1254-1263 (lines=10) @@ | ||
1251 | * |
|
1252 | * @return Stringy Object with the resulting $str after the replacements |
|
1253 | */ |
|
1254 | public function replaceAll(array $search, $replacement, $caseSensitive = true) |
|
1255 | { |
|
1256 | if ($caseSensitive) { |
|
1257 | $return = UTF8::str_replace($search, $replacement, $this->str); |
|
1258 | } else { |
|
1259 | $return = UTF8::str_ireplace($search, $replacement, $this->str); |
|
1260 | } |
|
1261 | ||
1262 | return static::create($return); |
|
1263 | } |
|
1264 | ||
1265 | /** |
|
1266 | * Replaces all occurrences of $search from the beginning of string with $replacement |