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

→‎K: add
(→‎K: add)
Line 1,848:
<pre>> stripChar("She was a soul stripper. She took my heart!", "aei")
Sh ws soul strppr. Sh took my hrt!</pre>
 
=={{header|K}}==
<syntaxhighlight lang="k">"She was a soul stripper. She took my heart!" ^ "aei"</syntaxhighlight>
{{out}}
<pre>"Sh ws soul strppr. Sh took my hrt!"</pre>
 
=={{header|Kotlin}}==
<syntaxhighlight lang="scalakotlin">// version 1.0.6
 
fun stripChars(s: String, r: String) = s.replace(Regex("[$r]"), "")
559

edits