From: "ryemcdonald@..." Date: 2007-07-20T01:40:00+09:00 Subject: Re: while gsub! On Jul 18, 5:18 pm, "Marcel Molina Jr." wrote: > On Thu, Jul 19, 2007 at 09:14:59AM +0900, ryemcdon...@gmail.com wrote: > > Is there a *better* way to perform multiple substitutions to a string > > than this? > > > string = '/../../....//........////../../etc/passwd' > > > while string.gsub!(/\.\.\//,'') > > end > > irb(main):001:>> string = '/../../....//........////../../etc/passwd' > => "/../../....//........////../../etc/passwd" > irb(main):002:0> File.expand_path(string) > => "/etc/passwd" > > marcel > -- > Marcel Molina Jr. that's great! thank you