From: Albert Schlef Date: 2012-07-20T03:03:11+09:00 Subject: Re: How to replace plain strings? Rajarathnam p. wrote in post #1069363: > Please try the following code which works "a b c".sub("b", > 'believe\\\+me'). Since this string isn't hardcoded, I'll have to write a function to add these slashes, and all this is becoming ugly: I don't want to waste time on debugging. I finally solved my problem by doing: "a b c".sub("b") { "believe\\+me" } But I wonder if this is the "best" Ruby has to offer for my very humble demands. -- Posted via http://www.ruby-forum.com/.