From: Phrogz Date: 2009-10-27T11:35:08+09:00 Subject: Re: array question On Oct 26, 6:46 pm, "David A. Black" wrote: > > need to separate strings into arrays for a program that I am making. > > For example, if I have the string 'abc', I'll want to make it into the > > array ['a', 'b', 'c'].  Is there any way to do this?  I am using version > > 1.8.6, by the way.  All help is welcome. > > The method you want is String#split: > >    'abc'.split(//)  # => ['a', 'b', 'c'] Here are two other techniques, just for fun: all_characters = "abc".scan(/./) all_characters=[] "abc".each_char{ |x| all_characters.push(x) }