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

Content added Content deleted
(GP)
(+Common Lisp)
Line 31: Line 31:
Sh ws soul strppr. Sh took my hrt!
Sh ws soul strppr. Sh took my hrt!
</pre>
</pre>

=={{header|Common Lisp}}==
<lang lisp>(defun strip-chars (str chars)
(remove-if (lambda (ch) (find ch chars)) str))

(strip-chars "She was a soul stripper. She took my heart!" "aei")
;; => "Sh ws soul strppr. Sh took my hrt!"
</lang>


=={{header|D}}==
=={{header|D}}==