StringToTitleCase
Converts a text string to title case by capitalising the first letter of each word.
Syntax
StringToTitleCase( StringValue );
Parameters
| Parameter Name | Type | Description | Optional? | Default Value |
|---|---|---|---|---|
| StringValue | String | The string to convert to title case. | No | n/a |
Output
The original string converted into title case.
Use Case
When a user types their name into an online form, they may be tempted to type it in capital letters, lower-case letters, or a mixture of both. The administrator of the form wants to present the person's name back to them in title case, for example by sending them a personalised e-mail after the form is submitted.
While they could use validation to prevent users from submitting the form unless their name is in title case, it's mainly an aesthetic preference, and since they'd rather not discourage people from using the site, they decide to convert the value after the user has submitted it.
To achieve this, they create the following expression:
VARUserName:= StringToTitleCase( FTUserName );
Now, if a user types their name as follows into the FTUserName question:
barney rubble
When they submit the form, the StringToTitleCase function will convert it, storing the following result in VARUserName:
Barney Rubble