Skip to content

Instantly share code, notes, and snippets.

@scottjbarr
Created January 28, 2010 07:20
Show Gist options
  • Save scottjbarr/288520 to your computer and use it in GitHub Desktop.
Save scottjbarr/288520 to your computer and use it in GitHub Desktop.
def sanitize(s)
# escape double quotes
s.gsub('"', '\"')
end
s = 'hello"'
puts sanitize(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment