Last active
December 19, 2016 18:23
-
-
Save stujo/7a112cede8e845f7851c4a74058bb7f0 to your computer and use it in GitHub Desktop.
Mutable Strings in Ruby
This file contains hidden or 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
puts "Assign bob = \"bob\"" | |
bob = "bob" | |
puts "bob_smith is also a bob" | |
puts "So bob_smith = bob (the variable reference)" | |
bob_smith = bob | |
puts "We want to capitalize bob so : bob.capitalize!" | |
bob.capitalize! | |
puts "No surprise for bob : #{bob}" | |
puts "But, is this a suprise to bob_smith? : #{bob_smith}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment