Skip to content

Commit

Permalink
Document fluent string wrap() (#9904)
Browse files Browse the repository at this point in the history
  • Loading branch information
weshooper authored Sep 18, 2024
1 parent 6e7ec33 commit ebbf48e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
[whenTest](#method-fluent-str-when-test)
[wordCount](#method-fluent-str-word-count)
[words](#method-fluent-str-words)
[wrap](#method-fluent-str-wrap)

</div>

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

// Perfectly balanced, as >>>

<a name="method-fluent-str-wrap"></a>
#### `wrap` {.collection-method}

The `wrap` method wraps the given string with an additional string or pair of strings:

use Illuminate\Support\Str;

Str::of('Laravel')->wrap('"');

// "Laravel"

Str::is('is')->wrap(before: 'This ', after: ' Laravel!');

// This is Laravel!

0 comments on commit ebbf48e

Please sign in to comment.