Transforms the first letter of a string to uppercase or the first letter of each word, and optionally lowercase uppercase characters.
ucFirst(string [, doAll] [, doLowerIfAllUppercase])
returns string
string.ucFirst([doAll] [, doLowerIfAllUppercase])
Name | Type | Required | Default | Description |
---|---|---|---|---|
string | string | Yes | ||
doAll | boolean | No | ||
doLowerIfAllUppercase | boolean | No |
Lucee4.5+ Capitalizes the first character of the first word only.
ucFirst("hello world!")
Lucee4.5+ Using the optional doAll parameter capitalizes the first character of all words. Word separators are: whitespace, period, parenthesis, or dash.
ucFirst("cfdocs.org is your (everyone's) resource for cf-related documentation!", true)
Lucee4.5+ Using the optional doLowerIfAllUppercase parameter allows for intelligent capitalization of words in all caps.
ucFirst("CFDOCS.ORG YOUR (EVERYONE'S) RESOURCE FOR CF-RELATED DOCUMENTATION!", true, true)