File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -294,11 +294,16 @@ Methods to Pad and Trim
294294 u(' Lorem Ipsum ')->trimStart(); // 'Lorem Ipsum '
295295 u(' Lorem Ipsum ')->trimEnd(); // ' Lorem Ipsum'
296296
297- // removes the given content(s) from the start/end of the string
298- u('file-0001.png')->trimPrefix('file-'); // '0001.png'
299- u('file-0001.png')->trimPrefix(['file-', 'image-']); // '0001.png'
297+ // removes the given content from the start/end of the string
298+ u('file-image-0001.png')->trimPrefix('file-'); // 'image-0001.png'
299+ u('file-image-0001.png')->trimPrefix('image-'); // 'file-image-0001.png'
300+ u('file-image-0001.png')->trimPrefix('file-image-'); // '0001.png'
301+ u('template.html.twig')->trimSuffix('.html'); // 'template.html.twig'
300302 u('template.html.twig')->trimSuffix('.twig'); // 'template.html'
301- u('template.html.twig')->trimSuffix(['.twig', '.html']); // 'template'
303+ u('template.html.twig')->trimSuffix('.html.twig'); // 'template'
304+ // when passing an array of prefix/sufix, only the first one found is trimmed
305+ u('file-image-0001.png')->trimPrefix(['file-', 'image-']); // 'image-0001.png'
306+ u('template.html.twig')->trimSuffix(['.twig', '.html']); // 'template.html'
302307
303308Methods to Search and Replace
304309~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments