| @@ 288-300 (lines=13) @@ | ||
| 285 | * @return static |
|
| 286 | * <p>Object with appended $suffix.</p> |
|
| 287 | */ |
|
| 288 | public function appendStringy(...$suffix): self |
|
| 289 | { |
|
| 290 | $suffixStr = ''; |
|
| 291 | foreach ($suffix as $suffixTmp) { |
|
| 292 | if ($suffixTmp instanceof CollectionStringy) { |
|
| 293 | $suffixStr .= $suffixTmp->implode(''); |
|
| 294 | } else { |
|
| 295 | $suffixStr .= $suffixTmp->toString(); |
|
| 296 | } |
|
| 297 | } |
|
| 298 | ||
| 299 | return static::create($this->str . $suffixStr, $this->encoding); |
|
| 300 | } |
|
| 301 | ||
| 302 | /** |
|
| 303 | * Append an unique identifier. |
|
| @@ 2660-2672 (lines=13) @@ | ||
| 2657 | * @return static |
|
| 2658 | * <p>Object with appended $prefix.</p> |
|
| 2659 | */ |
|
| 2660 | public function prependStringy(...$prefix): self |
|
| 2661 | { |
|
| 2662 | $prefixStr = ''; |
|
| 2663 | foreach ($prefix as $prefixTmp) { |
|
| 2664 | if ($prefixTmp instanceof CollectionStringy) { |
|
| 2665 | $prefixStr .= $prefixTmp->implode(''); |
|
| 2666 | } else { |
|
| 2667 | $prefixStr .= $prefixTmp->toString(); |
|
| 2668 | } |
|
| 2669 | } |
|
| 2670 | ||
| 2671 | return static::create($prefixStr . $this->str, $this->encoding); |
|
| 2672 | } |
|
| 2673 | ||
| 2674 | /** |
|
| 2675 | * Replaces all occurrences of $pattern in $str by $replacement. |
|