Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created September 28, 2011 15:29
Show Gist options
  • Save havenwood/1248229 to your computer and use it in GitHub Desktop.
Save havenwood/1248229 to your computer and use it in GitHub Desktop.
Need to see your code, gsub! works generally.
def smurfize(code)
puts code.gsub!("s", "smurfy")
end
code = "Lions and tigers and bears, oh my!"
smurfize code
#=> Lionsmurfy and tigersmurfy and bearsmurfy, oh my!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment