@@ -222,8 +222,8 @@ Methods to Change Case
222
222
u('foo BAR bάz')->localeUpper('el'); // 'FOO BAR BAZ'
223
223
224
224
// changes all graphemes/code points to "title case"
225
- u('foo ijssel')->title(); // 'Foo ijssel'
226
- u('foo ijssel')->title(true); // 'Foo Ijssel'
225
+ u('foo ijssel')->title(); // 'Foo ijssel'
226
+ u('foo ijssel')->title(allWords: true); // 'Foo Ijssel'
227
227
// changes all graphemes/code points to "title case" according to locale-specific case mappings
228
228
u('foo ijssel')->localeTitle('en'); // 'Foo ijssel'
229
229
u('foo ijssel')->localeTitle('nl'); // 'Foo IJssel'
@@ -269,20 +269,20 @@ Methods to Append and Prepend
269
269
u('UserControllerController')->ensureEnd('Controller'); // 'UserController'
270
270
271
271
// returns the contents found before/after the first occurrence of the given string
272
- u('hello world')->before('world'); // 'hello '
273
- u('hello world')->before('o'); // 'hell'
274
- u('hello world')->before('o', true); // 'hello'
272
+ u('hello world')->before('world'); // 'hello '
273
+ u('hello world')->before('o'); // 'hell'
274
+ u('hello world')->before('o', includeNeedle: true); // 'hello'
275
275
276
- u('hello world')->after('hello'); // ' world'
277
- u('hello world')->after('o'); // ' world'
278
- u('hello world')->after('o', true); // 'o world'
276
+ u('hello world')->after('hello'); // ' world'
277
+ u('hello world')->after('o'); // ' world'
278
+ u('hello world')->after('o', includeNeedle: true); // 'o world'
279
279
280
280
// returns the contents found before/after the last occurrence of the given string
281
- u('hello world')->beforeLast('o'); // 'hello w'
282
- u('hello world')->beforeLast('o', true); // 'hello wo'
281
+ u('hello world')->beforeLast('o'); // 'hello w'
282
+ u('hello world')->beforeLast('o', includeNeedle: true); // 'hello wo'
283
283
284
- u('hello world')->afterLast('o'); // 'rld'
285
- u('hello world')->afterLast('o', true); // 'orld'
284
+ u('hello world')->afterLast('o'); // 'rld'
285
+ u('hello world')->afterLast('o', includeNeedle: true); // 'orld'
286
286
287
287
Methods to Pad and Trim
288
288
~~~~~~~~~~~~~~~~~~~~~~~
@@ -395,17 +395,17 @@ Methods to Join, Split, Truncate and Reverse
395
395
u('Lorem Ipsum')->truncate(80); // 'Lorem Ipsum'
396
396
// the second argument is the character(s) added when a string is cut
397
397
// (the total length includes the length of this character(s))
398
- u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
398
+ u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
399
399
// if the third argument is false, the last word before the cut is kept
400
400
// 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'
402
402
403
403
::
404
404
405
405
// breaks the string into lines of the given length
406
- u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
406
+ u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
407
407
// 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'
409
409
410
410
// replaces a portion of the string with the given contents:
411
411
// the second argument is the position where the replacement starts;
@@ -419,7 +419,7 @@ Methods to Join, Split, Truncate and Reverse
419
419
u('0123456789')->chunk(3); // ['012', '345', '678', '9']
420
420
421
421
// reverses the order of the string contents
422
- u('foo bar')->reverse(); // 'rab oof'
422
+ u('foo bar')->reverse(); // 'rab oof'
423
423
u('さよなら')->reverse(); // 'らなよさ'
424
424
425
425
Methods Added by ByteString
0 commit comments