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

 

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

Write a method that returns a copy of 'str' but with all instances of 'ltr' removed. Also remove ANY letter that occurs immediately AFTER 'ltr'. For example, "about all are able", with 'a' being removed results in "out ll re le" since 'a' is removed along with any character immediately after it. Look at the test data for examples. Recursion is not required, but is allowed.


feb13_2020_APP1SLHL_removeLtr("This is a test", "i") → "Th a test"
feb13_2020_APP1SLHL_removeLtr("abababab", "a") → ""
feb13_2020_APP1SLHL_removeLtr("once an onion opened oil", "o") → "ce an i ened l"

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

public String feb13_2020_APP1SLHL_removeLtr(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