From: "Jan E." Date: 2012-04-17T00:57:27+09:00 Subject: Re: how to avoid escaping special chars after backslah in string Robert Klemme wrote in post #1056724: > On Fri, Apr 13, 2012 at 8:21 PM, Lucky Nl wrote: >> Roger Pack wrote in post #1056378: >>> so what's your ideal syntax here? >> >> i want to return string whatever i have given without escaping chars >> followed by slash.So can we do anything that slash also consider as a >> char like * in my example > > Escape the backslash: > > irb(main):001:0> puts 'a\\b' > a\b Well, the problem is he doesn't want to. He rather wants the backslash not to be an escape character (but it seems he doesn't want to use the heredoc syntax either). I'd say this is an impossible request. ;-) Even if you *did* make the backslash a normal character (by messing with the parser or whatever), there would still have to be an escape syntax -- with the exact same "problems" like the backslash. -- Posted via http://www.ruby-forum.com/.