.replaceAll(/s/g,'')
//Extenion function fun String.removeWhitespaces() = replace(" ", "") // Uses var str = "This is an example text".removeWhitespaces() println(str)
str = text.toLowerCase().replace(/[^A-Za-z0-9]/g,'');