How to Convert a String to Lowercase in Kotlin?
In Kotlin, To convert a string to lowercase we can use call lowercase()
function on this string. lowercase()
method returns a new string with all the characters in this string converted to lowercase.Example of converting string to lowercase in Kotlin
fun main(args: Array<String>) {
var str = "HELLO WORLD"
var result = str.lowercase()
println(result)
}
Output
hello world