forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice hcs-strings > hcsStringsGimmeNs
prev  |  next  |  chance

For the given input String, return an output String containing only the (i*num)-indexed characters from the original, in their original sequence. When num is 3 this means index 3, then index 6, then index 9 etc. NOTE that this method will skip index 0, even though 0 is definitely a multiple of num. Thus, the first index to get is actually... num!

hcsStringsGimmeNs("abcdefg", 2) → "ceg"
hcsStringsGimmeNs("aAaAaAa", 4) → "a"
hcsStringsGimmeNs("AaBbCcDd", 3) → "bD"

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

public String hcsStringsGimmeNs(String str, int num) { }

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

Copyright Nick Parlante 2017 - privacy