Created
December 15, 2011 19:10
-
-
Save shamil614/1482375 to your computer and use it in GitHub Desktop.
Escape single quotes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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