lowerCase()
The strLib.lowerCase() system function returns a copy of a character-type value and sets all the uppercase characters in that copy to lowercase. Numeric values are not affected.
If the input value is of a type other than String, a data conversion strips trailing blanks from the input value. To retain trailing blanks, use the strLib.lowerCaseChar() function instead. A later section gives examples.
To convert lowercase values to uppercase, use the strLib.upperCase() or strLib.upperCaseChar() function.
Syntax
strLib.lowerCase(
text STRING? in)
returns (result STRING?)
- text
- Input can be any variable or expression that is assignment compatible with the STRING type (see "Assignment compatibility in EGL").
- result
- A STRING value. If text is null, the function returns a null value.
Example
Consider the following code:
function main()
// each of the literals has 8 characters
myChar CHAR(5) = "ABC ";
myUnicode UNICODE(5) = "ABC ";
myString String = "ABC ";
sysLib.writeStdout(StrLib.lowerCase(myChar) +
"is, for lowerCase type Char");
sysLib.writeStdout(StrLib.lowerCaseChar(myChar) +
"is, for lowerCaseChar type Char");
sysLib.writeStdout(StrLib.lowerCase(myUnicode) +
"is, for lowerCase type Unicode");
sysLib.writeStdout(StrLib.lowerCaseChar(myUnicode) +
"is, for lowerCaseChar type Unicode");
sysLib.writeStdout(StrLib.lowerCase(myString) +
"is, for lowerCase type String");
sysLib.writeStdout(StrLib.lowerCaseChar(myString) +
"is, for lowerCaseChar type String");
endThe output is as follows:
abcis, for lowerCase type Char
abc is, for lowerCaseChar type Char
abcis, for lowerCase type Unicode
abc is, for lowerCaseChar type Unicode
abc is, for lowerCase type String
abc is, for lowerCaseChar type StringThe stripping of trailing blanks occurs during a data conversion from a non-String character type to a String. That conversion occurs before the strLib.lowerCase() function runs.
Compatibility
| Platform | Issue |
|---|---|
| COBOL generation | The strLib.lowerCase() function has no effect on double-byte characters. |