Ruby opinions (111)

31 Name: #!usr/bin/anon 2005-12-03 20:18 ID:4eo1Kiuj

>>26

irb(main):003:0> puts "\\".sub(/\\/, '\\\\')
\
=> nil
irb(main):004:0> "\\".sub(/\\/, '\\\\')
=> "\\"

Ahem :O. puts interprets the string exactly the way it should. The stray "\" at the end is cut off as it doesn't seem to escape anything.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: