From: Jacob Fugal Date: 2006-09-26T23:33:24+09:00 Subject: Re: Ruby's equivalent of PHP explode On 9/26/06, Farrel Lifson wrote: > On 26/09/06, voipfc@googlemail.com wrote: > > > > What is ruby's equivalent of PHPs explode? > > > > A routine which can breakdown a string and return the results in an > > array or a routine that can parse an .ini file and return the key > > value pairs in an array[key]=value. > > irb(main):006:0> "this is a string".split > => ["this", "is", "a", "string"] Also, can take an argument to split on a character/pattern besides space: irb>> "this is a string".split('s') => ["thi", " i", " a ", "tring"] irb>> "this is a string".split(/[aeiou]/) => ["th", "s ", "s ", " str", "ng"] Jacob Fugal