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

 

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

Write a method that accepts two strings as input parameters then returns an "interlaced" combination of the two strings. What that means is that a character is taken from str1, then a character from str2. This continues until there are no more characters left in whichever string is shorter. Note that either string could be the shorter one. Also note that you may only use the following string methods: .length, .charAt, .substring, .equals, and .compareTo


may_14_2019_APSLHL_interlace("Computer", "Programming") → "CPormopgurtaemrm"
may_14_2019_APSLHL_interlace("StarWars", "Dr.Who") → "SDtra.rWWhao"
may_14_2019_APSLHL_interlace("INTERLACED", "strings") → "IsNtTrEiRnLgAs"

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

public String may_14_2019_APSLHL_interlace(String str1, String str2) }

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

Copyright Nick Parlante 2017 - privacy