Open In App

Scala String toLowerCase() method with example

Last Updated : 29 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

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


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads