From: "Marcel Molina Jr." Date: 2007-07-19T09:18:20+09:00 Subject: Re: while gsub! On Thu, Jul 19, 2007 at 09:14:59AM +0900, ryemcdonald@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.