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

 

jebbert@volusia.k12.fl.us > quiz2023_05_31_SL_addString
prev  |  next  |  chance

Write a method that accepts a string 'str' and another string 'add'. Return a copy of 'str' but with 'add' inserted between each successive letter such that the number of copies between each successive letter continues to increase by one each time. For example, if 'str' is "Summer" and 'add' is "^*" you would return "S^*u^*^*m^*^*^*m^*^*^*^*e^*^*^*^*^*r"


quiz2023_05_31_SL_addString("Summer", "^*") → "S^*u^*^*m^*^*^*m^*^*^*^*e^*^*^*^*^*r"
quiz2023_05_31_SL_addString("abcdefg", "V") → "aVbVVcVVVdVVVVeVVVVVfVVVVVVg"
quiz2023_05_31_SL_addString("437", "01") → "401301017"

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

public String quiz2023_05_31_SL_addString(String str, String add) { }

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: 220

Copyright Nick Parlante 2017 - privacy