Skip to content

Commit 66f7daf

Browse files
committed
wip
1 parent 828efff commit 66f7daf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

strings.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
3535
[preg_replace_array](#method-preg-replace-array)
3636
[Str::after](#method-str-after)
3737
[Str::afterLast](#method-str-after-last)
38+
[Str::apa](#method-str-apa)
3839
[Str::ascii](#method-str-ascii)
3940
[Str::before](#method-str-before)
4041
[Str::beforeLast](#method-str-before-last)
@@ -117,6 +118,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
117118

118119
[after](#method-fluent-str-after)
119120
[afterLast](#method-fluent-str-after-last)
121+
[apa](#method-fluent-str-apa)
120122
[append](#method-fluent-str-append)
121123
[ascii](#method-fluent-str-ascii)
122124
[basename](#method-fluent-str-basename)
@@ -278,6 +280,17 @@ The `Str::afterLast` method returns everything after the last occurrence of the
278280

279281
// 'Controller'
280282

283+
<a name="method-str-apa"></a>
284+
#### `Str::apa()` {.collection-method}
285+
286+
The `Str::apa` method converts the given string to title case following the [APA guidelines](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case):
287+
288+
use Illuminate\Support\Str;
289+
290+
$title = Str::apa('Creating A Project');
291+
292+
// 'Creating a Project'
293+
281294
<a name="method-str-ascii"></a>
282295
#### `Str::ascii()` {.collection-method}
283296

@@ -1314,6 +1327,17 @@ The `afterLast` method returns everything after the last occurrence of the given
13141327

13151328
// 'Controller'
13161329

1330+
<a name="method-fluent-str-apa"></a>
1331+
#### `apa` {.collection-method}
1332+
1333+
The `apa` method converts the given string to title case following the [APA guidelines](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case):
1334+
1335+
use Illuminate\Support\Str;
1336+
1337+
$converted = Str::of('a nice title uses the correct case')->apa();
1338+
1339+
// A Nice Title Uses the Correct Case
1340+
13171341
<a name="method-fluent-str-append"></a>
13181342
#### `append` {.collection-method}
13191343

0 commit comments

Comments
 (0)