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).
-
-
-
Replying to @josh_cheek
@josh_cheek `str.gsub(/\\/, "\\\\").gsub(/'/, "\\'")` ? Or am I still missing something?1 reply 0 retweets 0 likes -
Replying to @josh_cheek
@josh_cheek Is that from inspect, or puts? If that's the output from inspect it's correct.1 reply 0 retweets 0 likes -
Replying to @josh_cheek
@josh_cheek The Ruby version is correct. If you `puts` it out, it'll have what you're looking for. Inspect escapes backslashes and double qs2 replies 0 retweets 0 likes
@josh_cheek double quotes*, because that's what the string literal version would look like
12:39 PM - 11 Aug 2014
0 replies
0 retweets
0 likes
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.