For a "fun time" in Ruby, take the string "'xo" and try to put a backslash before the single quote (in a way that works for any string).
-
-
@sgrif Generalize it so that it works for any string, ie a method: escape_single_quotes(string) -
@josh_cheek `str.gsub(/\\/, "\\\\").gsub(/'/, "\\'")` ? Or am I still missing something? - 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.