use strict; use warnings; my $str = "abcdefghiaabccdjklm"; my @chars = split //, $str; my %uniq; $uniq{$_}++ for @chars; $str = ''; for (@chars) { $str .= $_ unless $uniq{$_} > 1; } print $str; __END__ efghijklm
In reply to Re: How to remove duplicate characters in a string in place
by toolic
in thread How to remove duplicate characters in a string in place
by punitpawar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |