@@ -217,7 +217,7 @@ Methods to Change Case
217
217
218
218
// changes all graphemes/code points to "title case"
219
219
u('foo bar')->title(); // 'Foo bar'
220
- u('foo bar')->title(true); // 'Foo Bar'
220
+ u('foo bar')->title(allWords: true); // 'Foo Bar'
221
221
222
222
// changes all graphemes/code points to camelCase
223
223
u('Foo: Bar-baz.')->camel(); // 'fooBarBaz'
@@ -255,20 +255,20 @@ Methods to Append and Prepend
255
255
u('UserControllerController')->ensureEnd('Controller'); // 'UserController'
256
256
257
257
// returns the contents found before/after the first occurrence of the given string
258
- u('hello world')->before('world'); // 'hello '
259
- u('hello world')->before('o'); // 'hell'
260
- u('hello world')->before('o', true); // 'hello'
258
+ u('hello world')->before('world'); // 'hello '
259
+ u('hello world')->before('o'); // 'hell'
260
+ u('hello world')->before('o', includeNeedle: true); // 'hello'
261
261
262
- u('hello world')->after('hello'); // ' world'
263
- u('hello world')->after('o'); // ' world'
264
- u('hello world')->after('o', true); // 'o world'
262
+ u('hello world')->after('hello'); // ' world'
263
+ u('hello world')->after('o'); // ' world'
264
+ u('hello world')->after('o', includeNeedle: true); // 'o world'
265
265
266
266
// returns the contents found before/after the last occurrence of the given string
267
- u('hello world')->beforeLast('o'); // 'hello w'
268
- u('hello world')->beforeLast('o', true); // 'hello wo'
267
+ u('hello world')->beforeLast('o'); // 'hello w'
268
+ u('hello world')->beforeLast('o', includeNeedle: true); // 'hello wo'
269
269
270
- u('hello world')->afterLast('o'); // 'rld'
271
- u('hello world')->afterLast('o', true); // 'orld'
270
+ u('hello world')->afterLast('o'); // 'rld'
271
+ u('hello world')->afterLast('o', includeNeedle: true); // 'orld'
272
272
273
273
Methods to Pad and Trim
274
274
~~~~~~~~~~~~~~~~~~~~~~~
@@ -381,17 +381,17 @@ Methods to Join, Split, Truncate and Reverse
381
381
u('Lorem Ipsum')->truncate(80); // 'Lorem Ipsum'
382
382
// the second argument is the character(s) added when a string is cut
383
383
// (the total length includes the length of this character(s))
384
- u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
384
+ u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
385
385
// if the third argument is false, the last word before the cut is kept
386
386
// even if that generates a string longer than the desired length
387
- u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum'
387
+ u('Lorem Ipsum')->truncate(8, '…', cut: false); // 'Lorem Ipsum'
388
388
389
389
::
390
390
391
391
// breaks the string into lines of the given length
392
- u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
392
+ u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
393
393
// by default it breaks by white space; pass TRUE to break unconditionally
394
- u('Lorem Ipsum')->wordwrap(4, "\n", true); // 'Lore\nm\nIpsu\nm'
394
+ u('Lorem Ipsum')->wordwrap(4, "\n", cut: true); // 'Lore\nm\nIpsu\nm'
395
395
396
396
// replaces a portion of the string with the given contents:
397
397
// the second argument is the position where the replacement starts;
@@ -405,7 +405,7 @@ Methods to Join, Split, Truncate and Reverse
405
405
u('0123456789')->chunk(3); // ['012', '345', '678', '9']
406
406
407
407
// reverses the order of the string contents
408
- u('foo bar')->reverse(); // 'rab oof'
408
+ u('foo bar')->reverse(); // 'rab oof'
409
409
u('さよなら')->reverse(); // 'らなよさ'
410
410
411
411
Methods Added by ByteString
0 commit comments