From: Austin Ziegler Date: 2006-07-16T05:58:01+09:00 Subject: Re: using a \ in gsub On 7/15/06, brandon coleman wrote: > In IRB if I type the following: > "te/st".gsub('/','\') > into irb, IRB screws up. > but if I type > File.expand_path($0).gsub('/','\\') > I get te\\st. what gives?? how do I get ruby to come up with te\st? > > what I am trying to do is this: > File.expand_path($0).gsub('/','\') because with ruby in windows it uses > a / instead of a \ for path names which is screwing my pathnames up.. > any suggestions??? File.expand_path($0).gsub(%r{/}) { "\\" } -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca