The toUpper() method is utilized find the uppercase of the stated character value.
Method Definition: def toUpper: Char
Return Type: It returns Char.
Example: 1#
// Scala program of toUpper() // method // Creating object object GfG
{ // Main method
def main(args : Array[String])
{
// Applying toUpper() method
val result = 'a' .toUpper
// Displays output
println(result)
}
} |
Output:
A
Example: 2#
// Scala program of toUpper() // method // Creating object object GfG
{ // Main method
def main(args : Array[String])
{
// Applying toUpper() method
val result = 'b' .toUpper
// Displays output
println(result)
}
} |
Output:
B