Method to remove html escape characters from strings

Is there a convenient way of removing html escape characters from Strings? I could do using reg exp as in:

=> "hello & goodbye"

"hello & goodbye".gsub(/&/, "&")

=> "hello & goodbye"

but I figured there might be a better way.

thx.

Is there a convenient way of removing html escape characters from Strings? I could do using reg exp as in:

=> "hello & goodbye"

"hello & goodbye".gsub(/&/, "&")

=> "hello & goodbye"

but I figured there might be a better way.

require 'CGI'>> require 'CGI' => true >> CGI::unescapeHTML("hello &amp; goodbye &quot;bar&quot; &lt;baz&gt;") => "hello & goodbye "bar" <baz>"

That worked. Thanks!

If found this little snap that I got in my application_helper

  def remove_html_tags(str)     str.gsub(/<\/?[^>]*>/, "")   end