From: Robert Klemme Date: 2012-05-01T06:00:11+09:00 Subject: Re: delete character from array On Mon, Apr 30, 2012 at 7:11 PM, Brian Candler wrote: > I think this is right: > >>> a.gsub(/(..)./m) { $1 } > => "th qic bow fx ums ve te az dg" No need for a block. We can have it a bit more efficient irb(main):001:0> a = "the quick brown fox jumps over the lazy dog" => "the quick brown fox jumps over the lazy dog" irb(main):002:0> a.gsub /(..)./m, '\\1' => "th qic bow fx ums ve te az dg" But this deletes every third _character_. It will work the same for OP's strings but may not work in other cases. For really deleting _letters_ we could do irb(main):004:0> c=0; a.gsub(/\w/) {|ch| (c+=1) % 3 == 0 ? nil : ch} => "th quck ron fx jmp ovr te lzy og" Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/