Created
September 30, 2013 20:27
-
-
Save loganhasson/6769742 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 rev_in_place(sentence) | |
backwards = sentence.split.map { |word| word.reverse }.join(' ') | |
end |
I had no idea either...just figured I'd give it a go.
thanks brah
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had no idea you could chain a method to a block like that, but I guess it works because you're calling it on backwards. Slick