LCWORD: Converting a Character String to Mixed-Case

How to:

The LCWORD function converts the letters in a character string to mixed-case. It converts every alphanumeric character to lowercase except the first letter of each word and the first letter after a single or double quotation mark. For example, O'CONNOR is converted to O'Connor and JACK'S to Jack'S.

LCWORD skips numeric and special characters in the source string and continues to convert the following alphabetic characters. The result of LCWORD is a string in which the initial uppercase characters of all words are followed by lowercase characters.


Top of page

x
Syntax: How to Convert a Character String to Mixed-Case
LCWORD(length, source_string, output_format)

where:

length

Integer

Is the number of characters in the source_string and output_format.

source_string

Alphanumeric

Is the character string to be converted.

output_format

Alphanumeric



Example: Converting a Character String to Mixed-Case

LCWORD converts LAST_NAME to mixed-case and stores the result in a column with the format A15:

LCWORD(15, LAST_NAME, 'A15')

For STEVENS, the result is Stevens.

For SMITH, the result is Smith.


iWay Software