in reply to Re: Re: Range of chars except one
in thread Range of chars except one
True i thought about tr/// too...
but "a range of chars except one", could also be read "a range of chars PLUS one" (i like to reverse things up). tr/// also offer a complement modifier to it.
So when i need to delete chars, it seems more simple to write the one i actually want to keep, preventing me to forget some:
Creating that range could be easier...
It's just my two cents.
Freddo
So when i need to delete chars, it seems more simple to write the one i actually want to keep, preventing me to forget some:
$_ = "123,Let's keep letters!\nAnd new lines..." tr/A-Za-z \n//cd; print;will print:
Lets keep letters And new lines
Creating that range could be easier...
It's just my two cents.
Freddo
In Section
Seekers of Perl Wisdom