Project

General

Profile

Actions

Bug #1251

closed

gsub problem

Added by pettel (Alexander Pettelkau) over 15 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]
Backport:
[ruby-core:22715]

Description

=begin
I wanted to replace "" with "\" in the string "\TEST":

s="\TEST"
puts s # Output --> "\TEST"
s.gsub!("\","\\")
puts s # Output --> "\TEST"
# but EXPECTED Output "\TEST"
=end


Files

tr.rb (46 Bytes) tr.rb gsub doesn't replace as it should pettel (Alexander Pettelkau), 03/07/2009 06:09 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0