Skip to content

Commit cf6589e

Browse files
committed
[String] add named arguments
1 parent f35eec7 commit cf6589e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

string.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Methods to Change Case
223223

224224
// changes all graphemes/code points to "title case"
225225
u('foo ijssel')->title(); // 'Foo ijssel'
226-
u('foo ijssel')->title(true); // 'Foo Ijssel'
226+
u('foo ijssel')->title(allWords: true); // 'Foo Ijssel'
227227
// changes all graphemes/code points to "title case" according to locale-specific case mappings
228228
u('foo ijssel')->localeTitle('en'); // 'Foo ijssel'
229229
u('foo ijssel')->localeTitle('nl'); // 'Foo IJssel'
@@ -271,18 +271,18 @@ Methods to Append and Prepend
271271
// returns the contents found before/after the first occurrence of the given string
272272
u('hello world')->before('world'); // 'hello '
273273
u('hello world')->before('o'); // 'hell'
274-
u('hello world')->before('o', true); // 'hello'
274+
u('hello world')->before('o', includeNeedle: true); // 'hello'
275275

276276
u('hello world')->after('hello'); // ' world'
277277
u('hello world')->after('o'); // ' world'
278-
u('hello world')->after('o', true); // 'o world'
278+
u('hello world')->after('o', includeNeedle: true); // 'o world'
279279

280280
// returns the contents found before/after the last occurrence of the given string
281281
u('hello world')->beforeLast('o'); // 'hello w'
282-
u('hello world')->beforeLast('o', true); // 'hello wo'
282+
u('hello world')->beforeLast('o', includeNeedle: true); // 'hello wo'
283283

284284
u('hello world')->afterLast('o'); // 'rld'
285-
u('hello world')->afterLast('o', true); // 'orld'
285+
u('hello world')->afterLast('o', includeNeedle: true); // 'orld'
286286

287287
Methods to Pad and Trim
288288
~~~~~~~~~~~~~~~~~~~~~~~
@@ -398,14 +398,14 @@ Methods to Join, Split, Truncate and Reverse
398398
u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
399399
// if the third argument is false, the last word before the cut is kept
400400
// even if that generates a string longer than the desired length
401-
u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum'
401+
u('Lorem Ipsum')->truncate(8, '…', cut: false); // 'Lorem Ipsum'
402402

403403
::
404404

405405
// breaks the string into lines of the given length
406406
u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
407407
// by default it breaks by white space; pass TRUE to break unconditionally
408-
u('Lorem Ipsum')->wordwrap(4, "\n", true); // 'Lore\nm\nIpsu\nm'
408+
u('Lorem Ipsum')->wordwrap(4, "\n", cut: true); // 'Lore\nm\nIpsu\nm'
409409

410410
// replaces a portion of the string with the given contents:
411411
// the second argument is the position where the replacement starts;

0 commit comments

Comments
 (0)