From: Robert Klemme Date: 2012-04-17T05:26:59+09:00 Subject: Re: how to avoid escaping special chars after backslah in string On Mon, Apr 16, 2012 at 5:57 PM, Jan E. wrote: > 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. ;-) Absolutely. Thats's why I reinforced the proper solution. :-) > 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. Exactly. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/