I needed a ruby string with "\(" in it and found the escaping playing trick on me.
"\(" gives me "("
"\\(" gives me "\\("
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
"\\("is correct, the problem is that the result ofinspect(which is what IRB uses to display the return value of the last call) is not the same as the actual contents because of the escaping:If you don’t need interpolation, just use single quotes: