so, "A" & "B" (0b1000001 & 0b1000010) yields "@" (0b1000000), "A" & "C" (0b1000001 & 0b1000011) yields "A" (0b1000001), "B" & "C" yields "B".$ perl -e 'printf "$_ => %b\n", ord($_) for qw( A B C @ )' A => 1000001 B => 1000010 C => 1000011 @ => 1000000
So, for example:
"ABC" & "ABA" => "ABA" "ABB" & "ABA" => "AB@" "ABC" & "AB" => "AB" # perlop: "the & op acts as though the longer operand # were truncated to the length of the shorter" # so the strings don't have to be equal length # for that to work
In reply to Re^2: Tri state string compare? (Solved! see update2)
by Anonymous Monk
in thread Tri state string compare? (Solved! see update2)
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |