From: "Peña, Botp" Date: 2007-07-24T18:05:44+09:00 Subject: Re: finding positions in a string From: Skye Shaw!@#$ [mailto:skye.shaw@gmail.com] # On Jul 23, 9:10 pm, James Edward Gray II # wrote: # > Another idea is to use String#index() with the optional second # > minimum index parameter which you keep incrementing. # cool and simple indeed. # substr = Proc.new do |s,seq| # pos=0 # index=[] ^^^^^ rename. it might confuse us nubies :) # # while((i=s.index(seq,pos))!=nil) simplify. while i=s.index(seq,pos) # index<