Created
July 28, 2013 15:24
-
-
Save MrBean83/6098950 to your computer and use it in GitHub Desktop.
"Reverse Words"
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 reverse_words(str) | |
| words = str.split(" ") | |
| rev = words.reverse_each | |
| print rev | |
| end | |
| ---------- | |
| def reverse_words(str) | |
| words = str.split(" ") | |
| word = words.each.to_s | |
| print word.reverse! | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment