On Nov 8, 2007 5:40 AM, Surjit Nameirakpam <surjit.meitei / gmail.com> wrote:
>
> Array1 = [1,2,3,4,7,4]
>
> indexes to be delted is collected in an array del=[1,3] ..i.e i should
> delete 2 and 4 values
>
> i tried using
>
> Array1.delete_at(del[])
>
> but this doesn't work
>

Array1 = [1,2,3,4,7,4]
del = [1,3]
keep = []

(0...Array1.length).each do |x|
keep << Array1[x] unless del.include?(x)
end

p keep #> [1, 3, 7, 4]

Harry

-- 
A Look into Japanese Ruby List in English
http://www.kakueki.com/ruby/list.html