WordCap

Description

Capitalizes the first letter of each word in a passed script. It sets the remaining letters in each word to lowercase.

Applies to

All text objects

Syntax

WordCap ( text )

Argument

Description

text

String to be modified


Return value

String.

If it succeeds, returns the text passed in the function argument with the first letter of each word in uppercase and the remaining letters in lowercase. Returns null if an error occurs.

Examples

This example takes user-entered text from a SingleLineEdit control, capitalizing the first letter in each word and setting the other letters to lowercase, before passing it in a string variable:

string ls_fullname
ls_fullname = WordCap (sle_1.text)

The text joe MaCdonald would be rendered as Joe Macdonald by the WordCap function.