Strip a set of characters from a string: Difference between revisions
Strip a set of characters from a string (view source)
Revision as of 16:57, 17 June 2024
, 25 days agoAdd Uiua
(PascalABC.NET) |
(Add Uiua) |
||
Line 2,931:
<code>(do if (memq @1 set) (list @1))</code> is just <code>(lambda (item) (if (memq item set) (list item)))</code>.
<code>mappend</code> happily maps over strings and since the leftmost input sequence is a string, and the return values of the lambda are sequence of characters, <code>mappend</code> produces a string.
=={{header|Uiua}}==
{{works with|Uiua|0.11.1}}
<syntaxhighlight lang="uiua">
Strip ← ▽¬∊,
Strip "aei" "She was a soul stripper. She took my heart!"
</syntaxhighlight>
{{out}}
<pre>
"Sh ws soul strppr. Sh took my hrt!"
</pre>
=={{header|UNIX Shell}}==
|