From: Thomas Adam Date: 2005-05-19T05:50:19+09:00 Subject: Re: (newbie Q) opposite of inspect for strings > What is is opposite of inspect for strings, ie the function parsing > strings external representation (as strings)? > > i.e. I do know that "a\tb".inspect gives the 6 character string > "\"a\\tb\"" but what is the method or function that, given the > argument "\"a\\tb\"" produces the "a\tb" string of 3 characters? I'll try this, assuming I unserstand you correctly. >> a="a\tb" => "a\tb" >> p a.to_s "a\tb" Of course, calling to_s() on itself perhaps in this instance is silly, as you know what it is, but I think that does what you're asking? > Also how can I easily parse (ie read) from a file such a string like > the output of inspect? Can you provide an example of what you mean? Such as sample data? -- Thomas Adam -- "One of us is a cigar stand, and one of us is a lovely blue incandescent guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"