1

Here is my code:

"/home/roroco".gsub(%r{/}, "\\") # => "\home\roroco"
"/home/roroco".gsub(%r{/}, "\\\\") # => "\home\roroco"

I think the later one should be \\home\\roroco, why is it \home\roroco?

this is my ruby version:

roroco@roroco ~/Downloads $ ruby -version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
chikadance
  • 3,591
  • 4
  • 41
  • 73

0 Answers0