Delete all letters from String

Solution 1:

We can try regex replacement here:

val regex = """[A-Za-z]+""".toRegex()
val stringData = "ABC123.456"
val output = regex.replace(stringData, "")
println(output)  // 123.456