From: "Jesús Gabriel y Galán" Date: 2012-05-01T00:24:21+09:00 Subject: Re: delete character from array On Mon, Apr 30, 2012 at 5:19 PM, Ok Ok wrote: > > Here is my question... > > Say i have an array, a= ["aa"' "bb", "cc", "d", "e"] > > How can i delete any instances of a single character in the array, > without specifically specifying what they are, with something like > a.delete("d","e")? If I understand correctly, you want to delete all strings in the array that are of length 1? If so you can use delete_if (http://ruby-doc.org/core-1.9.2/Array.html#method-i-delete_if): 1.9.2p290 :001 > a= ["aa", "bb", "cc", "d", "e"] => ["aa", "bb", "cc", "d", "e"] 1.9.2p290 :002 > a.delete_if {|word| word.length == 1} => ["aa", "bb", "cc"] 1.9.2p290 :003 > a => ["aa", "bb", "cc"] Jesus.