Skip to content

Instantly share code, notes, and snippets.

@hpjaj
Created December 8, 2014 22:14
Show Gist options
  • Save hpjaj/df0f78b2a02da9f2fc49 to your computer and use it in GitHub Desktop.
Save hpjaj/df0f78b2a02da9f2fc49 to your computer and use it in GitHub Desktop.
week 3 - 9e - Reverse word order
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