J
Jeremy Woertink
I don't understand this.
irb(main):002:0> '\''
=> "'"
irb(main):003:0> '\\'
=> "\\"
irb(main):004:0>
I know the backslash escapes a character, so in the first line, I escape
the quote so it will return a string that is a single quote, but in the
second one I would expect it to return "\", instead it returns "\\" both
backslashes, and I only want one of them. My actual problem looks like
this:
irb(main):004:0> "(G\\D01=Name~\D02=1234~\\"
=> "(G\\D01=Name~D02=1234~\\"
The string that is returned is wrong,but if I do
irb(main):005:0> "(G\\D01=Name~\\D02=1234~\\"
=> "(G\\D01=Name~\\D02=1234~\\"
the string that is returned is still wrong.
~Jeremy
irb(main):002:0> '\''
=> "'"
irb(main):003:0> '\\'
=> "\\"
irb(main):004:0>
I know the backslash escapes a character, so in the first line, I escape
the quote so it will return a string that is a single quote, but in the
second one I would expect it to return "\", instead it returns "\\" both
backslashes, and I only want one of them. My actual problem looks like
this:
irb(main):004:0> "(G\\D01=Name~\D02=1234~\\"
=> "(G\\D01=Name~D02=1234~\\"
The string that is returned is wrong,but if I do
irb(main):005:0> "(G\\D01=Name~\\D02=1234~\\"
=> "(G\\D01=Name~\\D02=1234~\\"
the string that is returned is still wrong.
~Jeremy