Open In App

Scala String toLowerCase() method with example

Last Updated : 29 Oct, 2019
Comments
Improve
Suggest changes
Like Article
Like
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
// 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
// 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

Next Article

Similar Reads