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

 

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

Write a method that accepts two string input parameters, 'str' and 'mask'. The parameter 'mask' will be at least as long as the parameter 'str'. Return a new string constructed from 'str' using the characters in 'str' that are in the same location as any '#' character in the parameter 'mask'. Look at the test data for examples.


dec18_2015_APSLHL_stringMask("abcdefghijklmn", "#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#_#") → "acegikm"
dec18_2015_APSLHL_stringMask("Star Wars", "_###_xyz##") → "tars"
dec18_2015_APSLHL_stringMask("", "###########") → ""

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

public String dec18_2015_APSLHL_stringMask(String str, String mask) { }

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