The strLib.upperCase() 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.upperCaseChar() function instead.
To convert a character string to lowercase, use the strLib.lowerCase() or strLib.lowerCaseChar() function.
strLib.upperCase(
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.upperCase(myChar) +
"is, for upperCase type Char");
sysLib.writeStdout(StrLib.upperCaseChar(myChar) +
"is, for upperCaseChar type Char");
sysLib.writeStdout(StrLib.upperCase(myUnicode) +
"is, for upperCase type Unicode");
sysLib.writeStdout(StrLib.upperCaseChar(myUnicode) +
"is, for upperCaseChar type Unicode");
sysLib.writeStdout(StrLib.upperCase(myString) +
"is, for upperCase type String");
sysLib.writeStdout(StrLib.upperCaseChar(myString) +
"is, for upperCaseChar type String");
end
ABCis, for upperCase type Char
ABC is, for upperCaseChar type Char
ABCis, for upperCase type Unicode
ABC is, for upperCaseChar type Unicode
ABC is, for upperCase type String
ABC is, for upperCaseChar 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.upperCase() function runs.
| Platform | Issue |
|---|---|
| COBOL generation | The strLib.upperCase() function has no effect on double-byte characters. |