Skip to content

Commit ebbf48e

Browse files
authored
Document fluent string wrap() (laravel#9904)
1 parent 6e7ec33 commit ebbf48e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

strings.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
228228
[whenTest](#method-fluent-str-when-test)
229229
[wordCount](#method-fluent-str-word-count)
230230
[words](#method-fluent-str-words)
231+
[wrap](#method-fluent-str-wrap)
231232

232233
</div>
233234

@@ -3051,3 +3052,18 @@ The `words` method limits the number of words in a string. If necessary, you may
30513052
$string = Str::of('Perfectly balanced, as all things should be.')->words(3, ' >>>');
30523053

30533054
// Perfectly balanced, as >>>
3055+
3056+
<a name="method-fluent-str-wrap"></a>
3057+
#### `wrap` {.collection-method}
3058+
3059+
The `wrap` method wraps the given string with an additional string or pair of strings:
3060+
3061+
use Illuminate\Support\Str;
3062+
3063+
Str::of('Laravel')->wrap('"');
3064+
3065+
// "Laravel"
3066+
3067+
Str::is('is')->wrap(before: 'This ', after: ' Laravel!');
3068+
3069+
// This is Laravel!

0 commit comments

Comments
 (0)