File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,11 @@ Methods to Search and Replace
300300 u('avatar-73647.png')->match('/avatar-(\d+)\.png/');
301301 // result = ['avatar-73647.png', '73647']
302302
303+ // checks if the string contains any of the other given strings
304+ u('aeiou')->containsAny('a'); // true
305+ u('aeiou')->containsAny(['ab', 'efg']); // false
306+ u('aeiou')->containsAny(['eio', 'foo', 'z']); // true
307+
303308 // finds the position of the first occurrence of the given string
304309 // (the second argument is the position where the search starts and negative
305310 // values have the same meaning as in PHP functions)
@@ -327,6 +332,10 @@ Methods to Search and Replace
327332 return '['.$match[0].']';
328333 }); // result = '[1][2][3]'
329334
335+ .. versionadded :: 5.1
336+
337+ The ``containsAny() `` method was introduced in Symfony 5.1.
338+
330339Methods to Join, Split, Truncate and Reverse
331340~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332341
You can’t perform that action at this time.
0 commit comments