Skip to content
Related Articles

Related Articles

Improve Article

Scala String toLowerCase() method with example

  • Last Updated : 29 Oct, 2019
Geek Week

The toLowerCase() method is utilized to convert all the characters in the String into the lowercase.

Method Definition: String toLowerCase()

Return Type: It returns the resultant string after converting each character of the string into the lowercase.

Example: 1#




// Scala program of toLowerCase()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying toLowerCase method
        val result = "NIDHI".toLowerCase()
          
        // Displays output
        println(result)
      
    }
Output:
nidhi

Example: 2#




// Scala program of toLowerCase()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying toLowerCase method
        val result = "gEEKs".toLowerCase()
          
        // Displays output
        println(result)
      
    }
Output:
geeks



My Personal Notes arrow_drop_up
Recommended Articles
Page :