I have the string str = "xyz\123"
and I want to print it as is.
IRB gives me an unexpected result. Please find the same: -
1.9.2p290 :003 > str = "xyz\123" => "xyzS" 1.9.2p290 :004 >
Any ideas on how I can get IRB to print the original line, that is, "xyz \ 123".
Thanks..
UPDATE :
I tried to slip away from him, but for some reason this does not seem so simple. Below are my tests with the same:
1.9.2p290 :004 > str = "xyz'\'123" => "xyz''123" 1.9.2p290 :005 > str = "xyz'\\'123" => "xyz'\\'123" 1.9.2p290 :006 > str = "xyz'\\\'123" => "xyz'\\'123" 1.9.2p290 :007 >
source share