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

 

simona1@sfusd.edu > makeInWord
prev  |  next  |  chance

Given an "in" string length 4, such as "<<>>", and a word, return a new string where the "in" String is in the middle of the word, e.g. "wo<<>>rd". We'll say that length()/2 is the middle of the word whether or not the length is even. Note: use str.substring(i, j) to extract the String starting at index i and going up to but not including index j.


makeInWord("<<>>", "Yay") → "Y<<>>ay"
makeInWord("<<>>", "WooHoo") → "Woo<<>>Hoo"
makeInWord("[[]]", "word") → "wo[[]]rd"

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

public String makeInWord(String in, String word) { }

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

Copyright Nick Parlante 2017 - privacy