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))}%>
CODE
Structure
ecx:capitalizeFirstLetter(string)
Parameters
Parameter | Description |
---|
string | Specifies the target string. |