From: Hassan Schroeder Date: 2012-08-04T02:13:12+09:00 Subject: Re: Stacking gsub! commands? On Fri, Aug 3, 2012 at 9:59 AM, Wayne Brisette wrote: > my_string.gsub!(/>/, "<") > my_string.gsub!(/ > which works, but I'm sure is horribly inefficient. Is there a better way to do > multiple global substitutions on a string? 1.9.3p125 :001 > "".gsub(/[<>]/,'<' => '<', '>' => '>') => "<link>" There's a nice little example in the (cough) documentation... -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com http://about.me/hassanschroeder twitter: @hassan