QUOTE(chris_drappier @ 26 Jul, 2007 - 01:36 PM)

I have this
CODE
s1 = "this is a typing test"
s2 = gets.chomp
s1s = s1.split(//)
s2s = s2.split(//)
I want to compare each element of each array to the corresponding element in the other array like so:
CODE
s1s[0] == s2s[0]
s2s[1] == s2s[1]
s1s[2] == s2s[2]
and so on...
this has to happen automatically though because s1.length will be variable based on the specific string that's in there. I tried to iterate through the array with
CODE
s2s.each{
|i|
a = 0
i == s1s[a]
a + 1
}
but all the values return false even if s2 == s1. How can I maek this work?
plz gimme some ruby magic here thx

I'd just do:
CODE
foo = s1s & s2s (& creates an array from the matching values)
foo.length
I don't really get what your trying to do.
Maybe if you expand what on how your using this, it would make more sense.