Created
October 25, 2015 20:17
-
-
Save karapetyan/02694e6ed100b6d3625c to your computer and use it in GitHub Desktop.
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
def weirdcase string | |
string.split.map { |word| word.each_char.with_index.map { |char, index| index.even? ? char.upcase : char.downcase }.join }.join(" ") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment