in reply to Collapsing a string to unique characters
If the order of the characters is of no concern, you can do it in one regex and the lookup hash:
perl -wple "%seen=();s/(.)/$seen{$1}++?'':$1/ge"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Collapsing a string to unique characters
by dwhite20899 (Friar) on Jan 09, 2009 at 14:27 UTC |