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

 

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

Write a method that "splices" two strings together. Note that str2 will be at least as long as str1. When splicing strings, take a letter from the first string then a letter from the second string, then the next letter from the first string, and so on. Once you reach the end of the first string, just finish out the string with the characters from the second string. Look at the test data for examples. You may only use the following string methods: .length .charAt .equals


ggg1SpliceStrings("a", "b") → "ab"
ggg1SpliceStrings("", "first string was empty") → "first string was empty"
ggg1SpliceStrings("this-way", "and that-way") → "tahnids -twhaayt-way"

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

public String ggg1SpliceStrings(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: 230

Copyright Nick Parlante 2017 - privacy