--1926193751-770080717-12566412481234 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-770080717-1256641248=:11234" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-770080717-12566412481234 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi -- On Tue, 27 Oct 2009, Phrogz wrote: > On Oct 26, 6:46 ¨Βν¬ ΆΔαφιδ Α® ΒμαγλΆ Όδβμ®®®ΐςυβωπαμ®γονΎ χςοτεΊ >>> 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']. ¨Βτθεςαξχατο δο τθισ ¨Β αν υσιξφεςσιο>>> 1.8.6, by the way. ¨Βμμ θεμπ ισ χεμγονε® >> >> The method you want is String#split: >> >> abc'.split(//) ['a', 'b', 'c'] > > > Here are two other techniques, just for fun: > > all_characters abc".scan(/./) That won't include newline characters, though, unless you use the /m modifier. > all_characters > "abc".each_char{ |x| all_characters.push(x) } :-) Actually in 1.9 you could do: str.chars.to_a but he's using 1.8.6. David -- The Ruby training with D. Black, G. Brown, J.McAnally Compleat Jan 22-23, 2010, Tampa, FL Rubyist http://www.thecompleatrubyist.com David A. Black/Ruby Power and Light, LLC (http://www.rubypal.com) --1926193751-770080717-12566412481234-- --1926193751-770080717-12566412481234--