Am 03.08.2012 18:59, schrieb Wayne Brisette:
> I have a script that I wrote that uses nokogiri to parse some HTML, the results
> I get back, I need to change several of the HTML entities (><&), I thought I
> could stack the gsub! commands so they would be something like this:
>
> my_string.gsub!(/>/, "&lt;").gsub!(/</, "&gt;)
                                              ^^^^
>
> but I found that work, so for now I'm using:

It should work (without typo):

1.9.3p194 :001 > '<test>'.gsub!(/>/, '&lt;').gsub!(/</, '&gt;')
  => "&gt;test&lt;"

-- 
<https://github.com/stomar/>