From: Nathan Smith Date: 2007-01-23T10:17:47+09:00 Subject: Re: Placing tabs in strings in irb ------=_Part_267878_19810061.1169515057249 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline > > Actually, I tried this and it gives a string literal back > > =>"1\t2\t3\t4" > > This occurs as well if inserted into a full ruby script (not just irb). > > Lincoln Anderson In irb if you do a="1\t2\t3\t4" it replies with "1\t2\t3\t4". But, if you do puts a, it gives you: 1 2 3 4. The string must be in double quotes for this to work. > On a related note why is the value for the above string '1' if I use > a.to_i to display it? I would have expected an error. Extraneous characters past the end of a valid number are ignored, according to the docs. Nate ------=_Part_267878_19810061.1169515057249--