id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

srp4379@lausd.net > every2ndWordUpper
prev  |  next  |  chance

every2ndWordUpper(): Starting with the 2nd word, makes every other word UPPERCASE. So, "Mary had a little lamb." becomes "Mary HAD a LITTLE lamb." Assume that words are separated by a single space. Show Hint button is available.


every2ndWordUpper("Fourscore and seven years ago.") → "Fourscore AND seven YEARS ago."
every2ndWordUpper("Now is the time to come to the aid of your country.") → "Now IS the TIME to COME to THE aid OF your COUNTRY."
every2ndWordUpper("Mary had a little lamb.") → "Mary HAD a LITTLE lamb."

...Save, Compile, Run (ctrl-enter)

public String every2ndWordUpper(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 150 Post-solution available

Copyright Nick Parlante 2017 - privacy