Strip a set of characters from a string
sub strip_chars ( $s, $chars ) {
return $s.trans( $chars.comb X=> '' );
}
say strip_chars( 'She was a soul stripper. She took my heart!', 'aei' );
Output:
Sh ws soul strppr. Sh took my hrt!
sub strip_chars ( $s, $chars ) {
return $s.trans( $chars.comb X=> '' );
}
say strip_chars( 'She was a soul stripper. She took my heart!', 'aei' );
Sh ws soul strppr. Sh took my hrt!