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

 

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

Write a method that returns the string str, but with all occurrences of ltr removed from the string. You can only use the following string commands: .length, .substring, .charAt, .equals. Look at the test data for details. Keep in mind that this will be case sensitive, so only replace a letter if it matches the same case. Also, a "letter" can really be any symbol.


retestQuiz05272014RemoveLetter("This is a test", "i") → "Ths s a test"
retestQuiz05272014RemoveLetter("a man a plan a canal panama", "a") → " mn pln cnl pnm"
retestQuiz05272014RemoveLetter("what are you doing?", "z") → "what are you doing?"

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

public String retestQuiz05272014RemoveLetter(String str, char ltr) { }

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