forked from umakantp/jsmart
-
Notifications
You must be signed in to change notification settings - Fork 2
capitalize
pfaciana edited this page Sep 25, 2019
·
1 revision
Capitalizes the first letter of all words in a variable. This is similar to the PHP ucwords() function.
| Parameter Position | Type | Required | Default | Description |
|---|---|---|---|---|
| 1 | boolean | No | false | This determines whether or not words with digits will be uppercased |
| 2 | boolean | No | false | This determines whether or not Capital letters within words should be lowercased, e.g. "aAa" to "Aaa" |
{$articleTitle = 'next x-men film, x3, delayed.'}
{$articleTitle} // next x-men film, x3, delayed.
{$articleTitle|capitalize} // Next X-Men Film, x3, Delayed.
{$articleTitle|capitalize:true} // Next X-Men Film, X3, Delayed.