Strip a set of characters from a string: Difference between revisions
Strip a set of characters from a string (view source)
Revision as of 23:30, 26 December 2023
, 5 months ago→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="
fun stripChars(s: String, r: String) = s.replace(Regex("[$r]"), "")
|