about | help | code help+videos | done | prefs |
Write a method that returns a string that is just like 'str' except that every occurrence of 'replace' has been replaced with 'replaceWith'. As a precondition, you may assume that both 'replace' and 'replaceWith' will contain exactly one character. The only string methods you are allowed to use are .length, .equals, .substring, and .charAt. test2020_10_29_APP1SLHL_replace("minions", "i", "?") → "m?n?ons" test2020_10_29_APP1SLHL_replace("The minions are dressed as knights!", "s", "z") → "The minionz are drezzed az knightz!" test2020_10_29_APP1SLHL_replace("ha ha ha", "a", "R") → "hR hR hR" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy