From: Joby Bednar Date: 2006-01-12T12:13:05+09:00 Subject: Re: unit tests and string comparisons Just for fun... here's another quick visual method: s1 = 'abcdefghijk1mnOpqrstuvwxyz' s2 = 'abcdefghijklmn0pqrstuvwxyz' puts s1, s2 # XOR the binary of each character, will be 0 if the same s1.size.times {|i| print s1[i]^s2[i].to_i==0?'-':'#'} Results: abcdefghijk1mnOpqrstuvwxyz abcdefghijklmn0pqrstuvwxyz -----------#--#----------- (above looks better in a fixed font display) -Joby