about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 230
Copyright Nick Parlante 2017 - privacy