capitalize()
Usage
capitalize(string)
Description
Returns the capitalization of the given string.
Example
${capitalize('structr')}
results in
Structr
You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.
Usage
capitalize(string)
Description
Returns the capitalization of the given string.
Example
${capitalize('structr')}
results in
Structr
Capitalizes a String changing the first character to title case. No other characters are changed. If the first character has no explicit titlecase mapping and is not itself a titlecase char according to UnicodeData, then the uppercase mapping is returned as an equivalent titlecase mapping.
capitalize(string)
The find() function is another Structr built-in function, just like capitalize() we used in the page’s title and heading above. The find() function takes as argument the name of a type and returns a collection of all instances of this type.
Note how the title of the page starts with an uppercase letter, even though its name begins with a lowercase letter. The capitalize()
function turns the first character of a string to uppercase.
This expression is a call to the Structr system function capitalize(), which prints the first letter of the given string in upper case. As an argument to the capitalize function another expression is provided: