M
Michal Suchanek
Hello
I observe that backslashed characters normally produce backaslash plus
the character inside single quotes.
The understandable exception are single quotes. However, in Ruby
double backslash also produces a single backslash.
irb(main):008:0> '\a'
=> "\\a"
irb(main):009:0> '\\a'
=> "\\a"
irb(main):010:0> '\\\a'
=> "\\\\a"
irb(main):011:0> '\\\\a'
=> "\\\\a"
irb(main):012:0>
I think this is needlessly confusing. Usually single quotes are as
literal as possible.
Thanks
Michal
I observe that backslashed characters normally produce backaslash plus
the character inside single quotes.
The understandable exception are single quotes. However, in Ruby
double backslash also produces a single backslash.
irb(main):008:0> '\a'
=> "\\a"
irb(main):009:0> '\\a'
=> "\\a"
irb(main):010:0> '\\\a'
=> "\\\\a"
irb(main):011:0> '\\\\a'
=> "\\\\a"
irb(main):012:0>
I think this is needlessly confusing. Usually single quotes are as
literal as possible.
Thanks
Michal