Yet another (short) way:
my ( $str1, $str2 ) = ( 'ABCDE', 'BCDEO' ); my %count; $count{$_}++ for split //, $str1.$str2; print grep $count{$_} == 1, keys %count;
In reply to Re: compare two strings and return only he unique values.
by Not_a_Number
in thread compare two strings and return only he unique values.
by Learnlot1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |