Strip a set of characters from a string: Difference between revisions

Content added Content deleted
No edit summary
(→‎{{header|Kotlin}}: Corrected Kotlin solution: the use of regex is error-prone, e.g. `stripChars("fails to remove ] bracket", "aei]")`)
Line 1,875:
 
=={{header|Kotlin}}==
<syntaxhighlight lang="kotlin">//fun versionstripChars(s: 1String, r: String) = s.0.6filter { it !in r }
 
fun stripChars(s: String, r: String) = s.replace(Regex("[$r]"), "")
 
fun main(args: Array<String>) {