From: Gaurang Shah Date: 2011-07-22T00:33:11+09:00 Subject: Re: How to find the character in string yes you are right my string doesn't contain "\\", however I am using that in sub function with "\\" coz "\" is a escape character. So as you suggest, even if i made modification output is same. path = "C:\Gaurang\ruby\demo.xls" path.gsub("\\","\\\\") would you let me know why it's happening so ??? or say i just need to change "\" with "/", what should i write in gusub. Hans Mackowiak wrote in post #1012177: > its because "\\" is not in your string see my post in your other thread > > and > String path="C:\Gaurang\ruby\demo.xls" > is not good ruby code because it is interpreted as > String(path="C:\Gaurang\ruby\demo.xls") > with is meanless,use > path = 'C:\Gaurang\ruby\demo.xls' > or > path = "C:\\Gaurang\\ruby\\demo.xls" -- Posted via http://www.ruby-forum.com/.