Created
September 28, 2011 15:29
-
-
Save havenwood/1248229 to your computer and use it in GitHub Desktop.
Need to see your code, gsub! works generally.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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