Created
December 8, 2014 22:14
-
-
Save hpjaj/df0f78b2a02da9f2fc49 to your computer and use it in GitHub Desktop.
week 3 - 9e - Reverse word order
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_word_order(string) | |
string.split(" ").reverse.join(" ") | |
end | |
blah = "Hi there John" | |
puts reverse_word_order(blah) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment