| @@ 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. |
|
| @@ 3085-3097 (lines=13) @@ | ||
| 3082 | * @return static |
|
| 3083 | * <p>Object with appended $prefix.</p> |
|
| 3084 | */ |
|
| 3085 | public function prependStringy(...$prefix): self |
|
| 3086 | { |
|
| 3087 | $prefixStr = ''; |
|
| 3088 | foreach ($prefix as $prefixTmp) { |
|
| 3089 | if ($prefixTmp instanceof CollectionStringy) { |
|
| 3090 | $prefixStr .= $prefixTmp->implode(''); |
|
| 3091 | } else { |
|
| 3092 | $prefixStr .= $prefixTmp->toString(); |
|
| 3093 | } |
|
| 3094 | } |
|
| 3095 | ||
| 3096 | return static::create($prefixStr . $this->str, $this->encoding); |
|
| 3097 | } |
|
| 3098 | ||
| 3099 | /** |
|
| 3100 | * Replaces all occurrences of $pattern in $str by $replacement. |
|