@@ -41,6 +41,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
41
41
[ Str::between] ( #method-str-between )
42
42
[ Str::betweenFirst] ( #method-str-between-first )
43
43
[ Str::camel] ( #method-camel-case )
44
+ [ Str::charAt] ( #method-char-at )
44
45
[ Str::contains] ( #method-str-contains )
45
46
[ Str::containsAll] ( #method-str-contains-all )
46
47
[ Str::endsWith] ( #method-ends-with )
@@ -124,6 +125,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
124
125
[ between] ( #method-fluent-str-between )
125
126
[ betweenFirst] ( #method-fluent-str-between-first )
126
127
[ camel] ( #method-fluent-str-camel )
128
+ [ charAt] ( #method-fluent-str-char-at )
127
129
[ classBasename] ( #method-fluent-str-class-basename )
128
130
[ contains] ( #method-fluent-str-contains )
129
131
[ containsAll] ( #method-fluent-str-contains-all )
@@ -340,7 +342,19 @@ The `Str::camel` method converts the given string to `camelCase`:
340
342
341
343
$converted = Str::camel('foo_bar');
342
344
343
- // fooBar
345
+ // 'fooBar'
346
+
347
+ <a name =" method-char-at " ></a >
348
+
349
+ #### ` Str::charAt() ` {.collection-method}
350
+
351
+ The ` Str::charAt ` method returns the character at the specified index. If the index is out of bounds, ` false ` is returned:
352
+
353
+ use Illuminate\Support\Str;
354
+
355
+ $character = Str::charAt('This is my name.', 6);
356
+
357
+ // 's'
344
358
345
359
<a name =" method-str-contains " ></a >
346
360
#### ` Str::contains() ` {.collection-method}
@@ -1394,7 +1408,18 @@ The `camel` method converts the given string to `camelCase`:
1394
1408
1395
1409
$converted = Str::of('foo_bar')->camel();
1396
1410
1397
- // fooBar
1411
+ // 'fooBar'
1412
+
1413
+ <a name =" method-fluent-str-char-at " ></a >
1414
+ #### ` charAt ` {.collection-method}
1415
+
1416
+ The ` charAt ` method returns the character at the specified index. If the index is out of bounds, ` false ` is returned:
1417
+
1418
+ use Illuminate\Support\Str;
1419
+
1420
+ $character = Str::of('This is my name.')->charAt(6);
1421
+
1422
+ // 's'
1398
1423
1399
1424
<a name =" method-fluent-str-class-basename " ></a >
1400
1425
#### ` classBasename ` {.collection-method}
@@ -1405,7 +1430,7 @@ The `classBasename` method returns the class name of the given class with the cl
1405
1430
1406
1431
$class = Str::of('Foo\Bar\Baz')->classBasename();
1407
1432
1408
- // Baz
1433
+ // ' Baz'
1409
1434
1410
1435
<a name =" method-fluent-str-contains " ></a >
1411
1436
#### ` contains ` {.collection-method}
0 commit comments