From: "Peña, Botp" Date: 2008-09-22T16:04:24+09:00 Subject: Re: Ruby GSUB question From: Binh Ly [mailto:binh@pigbaby.net] # Remove # How would I go about replacing the single quotes ', with a # backslash and # single quote? \' you can try harder ;) puts "c'mon, it's cool!".gsub("'","\\\\'") c\'mon, it\'s cool! #=> nil or simply just, puts "c'mon, it's cool!".gsub("'"){"\\'"} c\'mon, it\'s cool!