Strip a set of characters from a string: Difference between revisions
Content added Content deleted
(added haskell) |
(→{{header|Perl 6}}: Added Perl 6 solution) |
||
Line 90: | Line 90: | ||
Sh ws soul strppr. Sh took my hrt! |
Sh ws soul strppr. Sh took my hrt! |
||
</pre> |
</pre> |
||
=={{header|Perl 6}}== |
|||
<lang perl6>sub strip_chars ( $s, $chars ) { |
|||
return $s.trans( $chars.comb X=> '' ); |
|||
} |
|||
say strip_chars( 'She was a soul stripper. She took my heart!', 'aei' );</lang> |
|||
Output:<pre>Sh ws soul strppr. Sh took my hrt!</pre> |
|||
=={{header|PHP}}== |
=={{header|PHP}}== |