Tom Lieber on 17 Jun 2006 00:10:08 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] Ruby gsub question

On 6/16/06, Chris <> wrote:
Using gsub you get two backslashes...

For just the (

You use single quotes for the second parameter, so it doesn't do any substitutions. Thus, you can just write:


Note that if you just type that into irb, it will show you two slashes
because it outputs with the escapes. This will show you what it really

puts "(hello)".gsub(/\(/,'\(')

Chris Lorenzo


Tom Lieber
talk mailing list