Methods
E
Class Public methods
escape(string)

Escapes &, “, > and < in string

# File lib/webrick/htmlutils.rb, line 18
def escape(string)
  return "" unless string
  str = string.b
  str.gsub!(/&/n, '&amp;')
  str.gsub!(/\"/n, '&quot;')
  str.gsub!(/>/n, '&gt;')
  str.gsub!(/</n, '&lt;')
  str.force_encoding(string.encoding)
end