The strLib.upperCaseChar() function returns a copy of a character-type value and sets all the lowercase characters in that copy to uppercase. 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 a character string to lowercase, use the strLib.lowerCaseChar() or strLib.lowerCase() function.
strLib.upperCaseChar(
text CHAR? in)
returns (result CHAR?)
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
| Platform | Issue |
|---|---|
| COBOL generation | The strLib.upperCaseChar() function has no effect on double-byte characters. |