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.
strLib.lowerCase(
text STRING? in)
returns (result STRING?)
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");
end
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 String
The 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.
| Platform | Issue |
|---|---|
| COBOL generation | The strLib.lowerCase() function has no effect on double-byte characters. |