@@ -424,7 +424,7 @@ You may also pass an array as the second argument. If the string ends with any o
424
424
<a name =" method-str-contains " ></a >
425
425
#### ` Str::contains() ` {.collection-method}
426
426
427
- The ` Str::contains ` method determines if the given string contains the given value. This method is case sensitive:
427
+ The ` Str::contains ` method determines if the given string contains the given value. By default this method is case sensitive:
428
428
429
429
use Illuminate\Support\Str;
430
430
@@ -440,6 +440,14 @@ You may also pass an array of values to determine if the given string contains a
440
440
441
441
// true
442
442
443
+ You may disable case sensitivity by setting the ` ignoreCase ` argument to ` true ` :
444
+
445
+ use Illuminate\Support\Str;
446
+
447
+ $contains = Str::contains('This is my name', 'MY', ignoreCase: true);
448
+
449
+ // true
450
+
443
451
<a name =" method-str-contains-all " ></a >
444
452
#### ` Str::containsAll() ` {.collection-method}
445
453
@@ -451,6 +459,14 @@ The `Str::containsAll` method determines if the given string contains all of the
451
459
452
460
// true
453
461
462
+ You may disable case sensitivity by setting the ` ignoreCase ` argument to ` true ` :
463
+
464
+ use Illuminate\Support\Str;
465
+
466
+ $containsAll = Str::containsAll('This is my name', ['MY', 'NAME'], ignoreCase: true);
467
+
468
+ // true
469
+
454
470
<a name =" method-ends-with " ></a >
455
471
#### ` Str::endsWith() ` {.collection-method}
456
472
@@ -1686,7 +1702,7 @@ You may also pass an array. If the string ends with any of the values in the arr
1686
1702
<a name =" method-fluent-str-contains " ></a >
1687
1703
#### ` contains ` {.collection-method}
1688
1704
1689
- The ` contains ` method determines if the given string contains the given value. This method is case sensitive:
1705
+ The ` contains ` method determines if the given string contains the given value. By default this method is case sensitive:
1690
1706
1691
1707
use Illuminate\Support\Str;
1692
1708
@@ -1702,6 +1718,14 @@ You may also pass an array of values to determine if the given string contains a
1702
1718
1703
1719
// true
1704
1720
1721
+ You can disable case sensitivity by setting the ` ignoreCase ` argument to ` true ` :
1722
+
1723
+ use Illuminate\Support\Str;
1724
+
1725
+ $contains = Str::of('This is my name')->contains('MY', ignoreCase: true);
1726
+
1727
+ // true
1728
+
1705
1729
<a name =" method-fluent-str-contains-all " ></a >
1706
1730
#### ` containsAll ` {.collection-method}
1707
1731
@@ -1713,6 +1737,14 @@ The `containsAll` method determines if the given string contains all of the valu
1713
1737
1714
1738
// true
1715
1739
1740
+ You can disable case sensitivity by setting the ` ignoreCase ` argument to ` true ` :
1741
+
1742
+ use Illuminate\Support\Str;
1743
+
1744
+ $containsAll = Str::of('This is my name')->containsAll(['MY', 'NAME'], ignoreCase: true);
1745
+
1746
+ // true
1747
+
1716
1748
<a name =" method-fluent-str-dirname " ></a >
1717
1749
#### ` dirname ` {.collection-method}
1718
1750
0 commit comments