From: Oscar Del Ben Date: 2008-05-30T18:28:45+09:00 Subject: Re: split a string at tab positions ------=_Part_15548_18133796.1212139739912 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline first, you should use double quote when you want to escape a character. >> s = "a\tb" => "a\tb" >> ss = s.split("\t") => ["a", "b"] 2008/5/30, suresh : > > Hi > > I am a newbie to ruby and when i tried to split a string at tab > positions, it didnt work. Could you please tell me where I am going > wrong? Code is pasted. > > #!/usr/bin/ruby1.9 > s = "a b" > ss = s.split('\t') > puts ss[0] > > It just prints the entire line without splitting... > > > suresh > > ------=_Part_15548_18133796.1212139739912--