LCWORD and LCWORD2: Converting a Character String to Mixed-Case

How to:

The LCWORD and LCWORD2 functions convert the letters in a character string to mixed-case. These functions convert character strings in the following way:

To use these functions, you must import the function library MNTUWS. For information on importing this library, see Accessing and Calling a Function.

There is also an LCWORD function available for both the reporting and Maintain languages. For information on this function, see Character Functions.

Syntax: How to Convert a Character String to Mixed-Case

{LCWORD|LCWORD2}(string)

where:

string

Alphanumeric

Is the character string to be converted, or a temporary field that contains the string.

Example: Converting a Character String to Mixed-Case

LCWORD and LCWORD2 convert the string O'CONNOR to mixed-case:

MAINTAIN FILE CAR
MODULE IMPORT (MNTUWS)
COMPUTE MYVAL1/A10="O'CONNOR";
  COMPUTE LC1/A10 = LCWORD(MYVAL1);
  COMPUTE LC2/A10 = LCWORD2(MYVAL1);
  TYPE "<<MYVAL1  <<LC1  <<LC2"
END

The output is:

MYVAL1     LC1        LC2  
------     ---        ---
O'CONNOR   O'Connor   O'connor