From: Milo Thurston Date: 2004-10-07T21:19:46+09:00 Subject: Index of multiple similar strings I'm trying to read through a file like this: http://www.genomics.ceh.ac.uk/~milo/example.html In order to count the number of N tracts and locate their positions. My code goes like this: dust_seq = # file in url above nums = 0 d.dust_seq.scan(/[N]+/) do |blah| nums += 1 puts "Index #{d.dust_seq.index(blah.to_s)}" done puts "Num of Ns: #{nums}" In the example, the index for the third of the N groups is reported as the same as the first, as it's small enough to fit within it. Is there any way around this? Thanks. -- www.sirwilliamhope.org