A
Ahmet Kilic
I want to compare same words in a and b then,
I wrote this,
$ye
$bu
a = "ali", "bel", "del","en"
b = "ali","bas","del","sx","en","sz","zen"
for xa in a
$ye= xa
end
b.each do |bx|
$bu = bx
if $ye == $bu
puts "#{$ye} and #{$bu}"
end
end
result:
=> en and en
but result is only "en and en". why the last one?
where is the others ali and del???
I wrote this,
$ye
$bu
a = "ali", "bel", "del","en"
b = "ali","bas","del","sx","en","sz","zen"
for xa in a
$ye= xa
end
b.each do |bx|
$bu = bx
if $ye == $bu
puts "#{$ye} and #{$bu}"
end
end
result:
=> en and en
but result is only "en and en". why the last one?
where is the others ali and del???