From: Kendall Gifford Date: 2009-06-13T02:53:25+09:00 Subject: Re: Remove double backslash in string "c:\\test" On Jun 12, 11:42 am, Peter Tosh wrote: > Hi, > > after lots of trying and searching, I still cant figure out how to > remove the second backslash in a string: > > "c:\\test" > > I need it with one backslash for a comparison in my db. > Here is my working IRB session example: irb(main):001:0> a = "c:\\\\test" # creates w/double backslashes irb(main):002:0> puts a.sub(/\\\\/, "\\") # prints replaced version