From: Ammar Ali Date: 2010-08-29T19:01:04+09:00 Subject: Re: delete char On Sun, Aug 29, 2010 at 12:02 PM, Pen Ttt wrote: > i want to make 'gkhj*&()' into 'gkhj',here is my code >  item='gkhj*&()' >  item=item.map{|echar| >  if /[a-z]/=~ echar then >    echar=echar >  else >    echar='' >  end} >  puts item > why i can't get what i want? > Any advice appriciated. Much easier to use gsub with a negative character set for this: puts item.gsub(/[^a-z]+/, '') HTH, Ammar