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

(Add ABC)
Line 1,465:
 
=={{header|F_Sharp|F#}}==
<syntaxhighlight lang="fsharp">let stripChars text (chars:string) =
let stripChars text (chars:string) =
ArraySeq.fold (
fun (s:string) c -> s.Replace(c.ToString(),"")
) text (chars.ToCharArray())
printfn "%s" (stripChars "She was a soul stripper. She took my heart!" "aei")
 
0</syntaxhighlight>
[<EntryPoint>]
{{out}}
let main args =
<pre>
printfn "%s" (stripChars "She was a soul stripper. She took my heart!" "aei")
<pre>Sh ws soul strppr. Sh took my hrt!</pre>
0</syntaxhighlight>
</pre>
Output
<pre>Sh ws soul strppr. Sh took my hrt!</pre>
 
=={{header|Factor}}==
2,172

edits