-
-
Save libryder/6650ad5399333f09f695 to your computer and use it in GitHub Desktop.
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
cylon:home davidryder$ irb | |
1.9.3p194 :001 > str = "Hello my name is David" | |
=> "Hello my name is David" | |
1.9.3p194 :003 > str2 = str | |
=> "Hello my name is David" | |
1.9.3p194 :004 > str2.gsub("David", "Rocky") | |
=> "Hello my name is Rocky" | |
1.9.3p194 :005 > str | |
=> "Hello my name is David" | |
1.9.3p194 :006 > str2.gsub!("David", "Rocky") | |
=> "Hello my name is Rocky" | |
1.9.3p194 :007 > str | |
=> "Hello my name is Rocky" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment