ecx:capitalizeFirstLetter
- 1 Minute to read
- Print
- DarkLight
ecx:capitalizeFirstLetter
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
The function ecx:capitalizeFirstLetter converts the first letter of a string to upper case. The value returned is a string data type.
Example
Today's date, including the day of the week, is inserted into a message. The day of the week appears as the first word in the phrase and must be capitalized. This element is not capitalized by default in French.
The function ecx:formatDate formats the date in French, and ecx:capitalizeFirstLetter corrects the capitalization. The expression that inserts the result into a message is constructed as follows:
<%${ecx:capitalizeFirstLetter(ecx:formatDate(date.today, 'EEEE d MMMMM yyyy', ecm:timeZone('Europe/London'), 'fr', true))}%>
Structure
ecx:capitalizeFirstLetter(string)
Parameters
Parameter | Description |
---|---|
string | Specifies the target string. |
Was this article helpful?