Oh, I didn't read the whole question. `Regex.repla...
# announcements
m
Oh, I didn't read the whole question.
Regex.replace
returns a new
String
. You need to do something like
Copy code
class StringParser(val string: String){
    fun removeHTMLTags() = StringParser(Regex("<[^>]*>").replace(string, ""))
    fun removeSpecialCharacters() = StringParser(Regex("[^A-Za-z0-9 ]").replace(string, ""))
}