The ruby quotes can be printed in a row, if it immediately precedes the backslash: print " \" " .
print " \" "
But how do I print \" in ruby ββwithout the backslash disappearing due to the presence of the quote mark just before it?
\"
Thanks in advance.
You can use single quote ( ' ) instead of double quote ( " ) to prevent interpretation of the escape sequence:
'
"
irb(main):001:0> print '\"' \"=> nil
or %q{...} , if there are many in the line ' :
%q{...}
irb(main):002:0> print %q{\"} \"=> nil