Kevin Smith <kevins14 / pacbell.net> writes:

> >"Chris Morris" <chrismo / homemail.com> writes:
> >
> >> How can I have a string with a single backslash as the last character?
> >> 
> >>   "c:\temp\\"         => "c:\temp\\"
> >
> >Just like that. If you're using irb to check it out, then you'll get
> >slightly misleading output, as irb by default uses #inspect to display 
> >strings, and #inspect escapes special characters. Thus even though the 
> >string has just one '\', it is output by irb with two.
> 
> Correct me if I'm wrong, but I believe that should be:
> "c:\\temp\\", unless you really want a tab after the colon.

'tis true - I was concentrating on the end one.

> 
> And, correct me if I'm wrong, but I believe that you could instead use:
> 'c:\temp\', since ' ' strings don't expand escape sequences.

'tis false. Single quoted string use \ to escape \ and '

   'fred\'s slash\\'


Dave