From: Stefan Rusterholz Date: 2007-11-18T07:52:14+09:00 Subject: Re: String escape mystery. Rick Denatale wrote: > I can't figure out what's happening here: > > shadowfax:~ rick$ ruby -ve'p "a\b\c"' > ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.2] > -e:1: unterminated string meets end of file > > shadowfax:~ rick$ ruby -e'p "a\b\\c"' > "a\b\\c" > > shadowfax:~ rick$ ruby -e'puts "a\b\\c"' > \c > shadowfax:~ rick$ > > What's up with \c in a string literal? > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ Hu? I fail to see what exactly is your problem. \b is backspace, so the a becomes deleted in the output. In the inspect of course it still shows up. \\ is a literal \ and that is followed by a c, so "\\c" naturally prints as \c Did I miss your point or so? Regards Stefan -- Posted via http://www.ruby-forum.com/.