Created
October 20, 2018 15:01
-
-
Save SrdjanCoric/35fdd80d7cc71c29572e3e56213b8cc7 to your computer and use it in GitHub Desktop.
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
def spin_me(str) | |
str.split.each do |word| | |
word.reverse! | |
end.join(" ") | |
end | |
str = 'hello world' | |
puts str.object_id # 47435609148580 | |
puts spin_me(str).object_id # 47435609148360 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment