Skip to content

Instantly share code, notes, and snippets.

@launchkit-codes
Created January 27, 2015 12:48
Show Gist options
  • Select an option

  • Save launchkit-codes/30c437a24aded95c189e to your computer and use it in GitHub Desktop.

Select an option

Save launchkit-codes/30c437a24aded95c189e to your computer and use it in GitHub Desktop.
Ruby String#gsub with hash params
"olo".gsub(/[ol]/, 'o' => 'l', 'l' => 'o')
# output
#
# 'lol'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment