6 kyu
WeIrD StRiNg CaSe
24,275 of 49,768xDranik
Description:
Write a function that accepts a string, and returns the same string with all even indexed characters in each word upper cased, and all odd indexed characters in each word lower cased. The indexing just explained is zero based, so the zero-ith index is even, therefore that character should be upper cased and you need to start over for each word.
The passed in string will only consist of alphabetical characters and spaces(' '
). Spaces will only be present if there are multiple words. Words will be separated by a single space(' '
).
Examples:
"String" => "StRiNg"
"Weird string case" => "WeIrD StRiNg CaSe"
Strings
Algorithms
Similar Kata:
Stats:
Created | Dec 22, 2013 |
Published | Dec 23, 2013 |
Warriors Trained | 87553 |
Total Skips | 10840 |
Total Code Submissions | 189287 |
Total Times Completed | 49768 |
JavaScript Completions | 24275 |
CoffeeScript Completions | 188 |
Ruby Completions | 3242 |
Haskell Completions | 853 |
Python Completions | 14374 |
C# Completions | 3054 |
PHP Completions | 1737 |
Go Completions | 2195 |
Factor Completions | 10 |
C Completions | 422 |
C++ Completions | 335 |
Lua Completions | 31 |
Total Stars | 780 |
% of votes with a positive feedback rating | 89% of 4353 |
Total "Very Satisfied" Votes | 3525 |
Total "Somewhat Satisfied" Votes | 705 |
Total "Not Satisfied" Votes | 123 |