From: Hans Mackowiak Date: 2011-07-22T00:49:14+09:00 Subject: Re: How to replace "\" from string. ya what work is path.gsub("\\","\\\\") but this also not work BECAUSE your main string path has no "\\" inside so gsub does not replace something and you can not replace the \ inside path = "C:\Gaurang\ruby\demo.xls" because its interpreted as \G \r and \d if you does not want to write path = "C:\\Gaurang\\ruby\\demo.xls" you chould write inside ' ' (the char above #) path = 'C:\Gaurang\ruby\demo.xls' you can do nothing with "C:\Gaurang\ruby\demo.xls" -- Posted via http://www.ruby-forum.com/.