Created
June 11, 2013 04:07
-
-
Save surrealdetective/5754420 to your computer and use it in GitHub Desktop.
method chaining to the meaning of life
This file contains 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
puts "what is the meaning of life?".slice(12, 7) | |
# => meaning | |
puts "what is the meaning of life?".slice(12, 7).concat(" can the universe really provide? ") | |
# => meaning can the universe really provide? | |
puts "what is the meaning of life?".slice(12, 7).concat(" can the universe really provide? ").reverse | |
# => ?edivorp yllaer esrevinu eht nac gninaem | |
puts "what is the meaning of life?".slice(12, 7).concat(" can the universe really provide? ").reverse.strip | |
# => ?edivorp yllaer esrevinu eht nac gninaem | |
puts "what is the meaning of life?".slice(12, 7).concat(" can the universe really provide? ").reverse.chomp.length | |
42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment