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

 

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

Write a method that accepts a string 'str' and a character 'removeLtr'. Return the string 'str' but with all instances of 'removeLtr' removed from 'str'. You method needs to be case-sensitive, so if 'removeLtr' is a 'g' only lower-case g's get removed (for example). The only string methods allowed are: .length, .charAt, .substring, .equals, and .compareTo. Look at the test data for examples.


nov21_2019_APP1SLHL_remove("", "x") → ""
nov21_2019_APP1SLHL_remove("aaaaa", "a") → ""
nov21_2019_APP1SLHL_remove("This is a test of the emergency letter removal system.", "e") → "This is a tst of th mrgncy lttr rmoval systm."

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

public String nov21_2019_APP1SLHL_remove(String str, char removeLtr) { }

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