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

 

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

Write a method that returns a string that is made from every-other character in the input parameter string. For example, if the input parameter string is "sailboat" you would return "siba". Look at the test data for additional examples. The ONLY string methods you are allowed to use are .length, .equals, .charAt, and .substring. You do not need to use all of these. You may also use all of the normal string operations such as concatenation.


nov20_2015_APSLHL_everyOtherLetter("This is a test") → "Ti sats"
nov20_2015_APSLHL_everyOtherLetter("abcdefghijk") → "acegik"
nov20_2015_APSLHL_everyOtherLetter("X") → "X"

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

public String nov20_2015_APSLHL_everyOtherLetter(String str) { }

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

Copyright Nick Parlante 2017 - privacy