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

 

orion.a.smith@gmail.com hcs-strings > apcsaStringsBabyTalk
prev  |  next  |  chance

Given an input String with multiple words separated by spaces, return a String with the first word repeated twice, separated by a space. Precondition: the location of the first space character is greater than 0.


HINT

The first word is everything before the first space.

apcsaStringsBabyTalk("stop in the name of the law") → "stop stop"
apcsaStringsBabyTalk("My good fellows") → "My My"
apcsaStringsBabyTalk("La la land") → "La La"

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

public String apcsaStringsBabyTalk(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

Copyright Nick Parlante 2017 - privacy