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

 

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

NOTE: This problem has restrictions regarding what string methods you are allowed to use. The ONLY string methods you are allowed to use are: .length, .substring, .charAt, and .equals. You may NOT use any other string methods. Preconditions: 'orig' contains a string of any length. 'remove' contains a string with a single character in it. 'replace' contains a string of any length. Write a method that returns a new string based on the string 'orig'. The new string has every instance of 'remove' removed and replaced with 'replace'. Remember that 'remove' will be a single character, but 'replace' can be any length (including length zero). Look at the test data for examples.


test2023_12_07_APP1SLHL_removeLetter("", "X", "Y") → ""
test2023_12_07_APP1SLHL_removeLetter("Since the 'replace' string is empty, this will effectively just remove the 'remove' character.", "i", "") → "Snce the 'replace' strng s empty, ths wll effectvely just remove the 'remove' character."
test2023_12_07_APP1SLHL_removeLetter("gg gamer", "g", "@") → "@@ @amer"

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

public String test2023_12_07_APP1SLHL_removeLetter(String orig, String remove, String replace) { }

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

Copyright Nick Parlante 2017 - privacy