📜  带有示例的 Scala Char toUpper() 方法

📅  最后修改于: 2022-05-13 01:55:07.891000             🧑  作者: Mango

带有示例的 Scala Char toUpper() 方法

toUpper()方法用于查找指定字符值的大写。

示例: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)
      
    }
} 
输出:
A

示例: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)
      
    }
} 
输出:
B