The toUpperCase() method is utilized to convert all the characters of the stated string to uppercase.
Scala Scala
Method Definition: String toUpperCase() Return Type: It returns the resultant string after converting its all the character to uppercase.Example: 1#
// Scala program of toUpperCase()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying toUpperCase method
val result = "GeeksforGeeks".toUpperCase()
// Displays output
println(result)
}
}
Output:
Example: 2#
GEEKSFORGEEKS
// Scala program of toUpperCase()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying toUpperCase method
val result = "nid#!".toUpperCase()
// Displays output
println(result)
}
}
Output:
NID#!