Skip to content

Instantly share code, notes, and snippets.

@chrismear
Created August 26, 2009 22:36
Show Gist options
  • Save chrismear/175904 to your computer and use it in GitHub Desktop.
Save chrismear/175904 to your computer and use it in GitHub Desktop.
def replace_things(string)
string = string.gsub(/lice/, 'dam')
end
def alter_things(string)
string.gsub!(/lice/, 'dam')
end
person = "Alice"
p person
# "Alice"
replace_things(person)
p person
# "Alice"
alter_things(person)
p person
# "Adam"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment