escapeHTML() in Ruby

By: Jeeva Printer Friendly Format    


escapeHTML(string)

Escape special characters in HTML, namely &\"<>

  CGI::escapeHTML('Usage: foo "bar" <baz>')
     # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"


Ask a Question



Most Viewed Articles (in Ruby )

Latest Articles (in Ruby)

Comment on this tutorial