@@ 326-338 (lines=13) @@ | ||
323 | * @return static |
|
324 | * <p>Object with appended $suffix.</p> |
|
325 | */ |
|
326 | public function appendStringy(...$suffix): self |
|
327 | { |
|
328 | $suffixStr = ''; |
|
329 | foreach ($suffix as $suffixTmp) { |
|
330 | if ($suffixTmp instanceof CollectionStringy) { |
|
331 | $suffixStr .= $suffixTmp->implode(''); |
|
332 | } else { |
|
333 | $suffixStr .= $suffixTmp->toString(); |
|
334 | } |
|
335 | } |
|
336 | ||
337 | return static::create($this->str . $suffixStr, $this->encoding); |
|
338 | } |
|
339 | ||
340 | /** |
|
341 | * Append an unique identifier. |
|
@@ 3217-3229 (lines=13) @@ | ||
3214 | * @return static |
|
3215 | * <p>Object with appended $prefix.</p> |
|
3216 | */ |
|
3217 | public function prependStringy(...$prefix): self |
|
3218 | { |
|
3219 | $prefixStr = ''; |
|
3220 | foreach ($prefix as $prefixTmp) { |
|
3221 | if ($prefixTmp instanceof CollectionStringy) { |
|
3222 | $prefixStr .= $prefixTmp->implode(''); |
|
3223 | } else { |
|
3224 | $prefixStr .= $prefixTmp->toString(); |
|
3225 | } |
|
3226 | } |
|
3227 | ||
3228 | return static::create($prefixStr . $this->str, $this->encoding); |
|
3229 | } |
|
3230 | ||
3231 | /** |
|
3232 | * Replaces all occurrences of $pattern in $str by $replacement. |