/endless-summer

In Search of the Perfect Wave

Primary LanguageRuby

eNdLeSs SuMmEr

You've just moved to the valley to join hot "uber-for-surfers" startup "SurfSpot". Your new CEO wants all promotional copy to go out in 'Wave Case', a formatting convention that alternates lowercase and uppercase lettering. Your task is to write a method that will automate this format.

Your method should take a string and return a string in wavecase. To take a simple example:

  • to_wavecase("surfspot") # => 'SuRfSpOt'

And, in the case of a sentence:

  • to_wavecase("Colourless green ideas sleep furiously") # => 'CoLoUrLeSs GrEeN iDeAs SlEeP fUrIoUsLy.'

HAVE FUN!

... think you have a solution? Study the second example carefully. ;-)