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

added standard ml
(added php)
(added standard ml)
Line 149:
<lang ruby>>> "She was a soul stripper. She took my heart!".delete("aei")
=> "Sh ws soul strppr. Sh took my hrt!"</lang>
 
=={{header|Standard ML}}==
<lang sml>fun stripchars (string, chars) = let
fun aux c =
if String.isSubstring (str c) chars then
""
else
str c
in
String.translate aux string
end</lang>
 
testing in the interpreter:
 
<pre>- stripchars ("She was a soul stripper. She took my heart!", "aei") ;
val it = "Sh ws soul strppr. Sh took my hrt!" : string</pre>
 
=={{header|Tcl}}==
Anonymous user