in reply to compare two strings and return only he unique values.
Yet another (short) way:
my ( $str1, $str2 ) = ( 'ABCDE', 'BCDEO' ); my %count; $count{$_}++ for split //, $str1.$str2; print grep $count{$_} == 1, keys %count;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: compare two strings and return only he unique values.
by Kenosis (Priest) on Feb 03, 2013 at 21:17 UTC | |
by Not_a_Number (Prior) on Feb 03, 2013 at 22:40 UTC | |
by Kenosis (Priest) on Feb 03, 2013 at 23:34 UTC |
In Section
Seekers of Perl Wisdom