lowerCaseChar()
The strLib.lowerCaseChar() 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.
The function retains trailing blanks from the value of an input. If you want to strip trailing blanks from an input value that is of a type other than String, use the strLib.lowerCase() function instead.
To convert lowercase values to uppercase, use the strLib.upperCaseChar() or strLib.upperCase() function.
Syntax
strLib.lowerCaseChar(
text CHAR? in)
returns (result CHAR?)
- text
- Input can be any variable or expression that is assignment compatible with the CHAR type (see "Assignment compatibility in EGL").
- result
- A CHAR 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 StringCompatibility
| Platform | Issue |
|---|---|
| COBOL generation | The strLib.lowerCaseChar() function has no effect on double-byte characters. |