Scala String toLowerCase() method with example
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) } } |
chevron_right
filter_none
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) } } |
chevron_right
filter_none
Output:
geeks