LCWORD: Converting a 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 new word and the first letter after a single or double quotation mark, which it converts to uppercase. 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)

where:

length

Integer

Is the number of characters in source_string and output.

string

Alphanumeric

Is the character string to be converted.

output

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