From: Harold Hausman Date: 2007-06-07T07:10:35+09:00 Subject: Re: Error when substituting a backslash in a string On 6/6/07, Federico Zagarzaz� wrote: > Hi, > > Why can't I substitute a single backslash in a string? > > a = "\\6" > p a # => "\\6" > puts a # => \6 > p a.sub('\', '') > On that last line, your backslash is escaping the single quote and causing parsing lossage. How's about this: p a.sub("\\", '') Hope that helps, -Harold