Skip to content

Instantly share code, notes, and snippets.

@chmeee
Created April 26, 2011 08:19
Show Gist options
  • Save chmeee/941975 to your computer and use it in GitHub Desktop.
Save chmeee/941975 to your computer and use it in GitHub Desktop.
Makes substitution from a hash of regexp => subs
class String
def gsubh!(regexph)
regexph.each {|r, s| self.gsub!(r, s) }
self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment