Project

General

Profile

Actions

Bug #8136

closed

gsub strange behavior when substituting "\\'"

Added by alexeymuranov (Alexey Muranov) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.0.0
Backport:
[ruby-core:53602]

Description

=begin
s = "\'" # => "\'"
print s # '
"foo".gsub("f", s) # => "oooo"

Can anybody please explain to me why it works like this? Is this a bug?
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0