Skip to content

Instantly share code, notes, and snippets.

@shamil614
Created December 15, 2011 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shamil614/1482375 to your computer and use it in GitHub Desktop.
Save shamil614/1482375 to your computer and use it in GitHub Desktop.
Escape single quotes
class String
def escape_single_quotes
self.gsub(/[']/, '\\\\\'')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment