The toLowerCase() method is utilized to convert all the characters in the String into the lowercase.
Scala
Scala
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:
Example: 2#
nidhi
// 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