about | help | code help+videos | done | prefs |
For this problem, the only string methods you are allowed to use are .length, .substring, .charAt, and .equals. You are not required to use all of those methods. You can, as always, also use string concatenation and assignment. Write a method that accepts a string parameter and a character parameter. Return a new string that is identical to the string parameter except that all occurrences of the character have been replaced with a '-'. For example, if the string parameter is "this is a test" and the character to replace is 'i', you will return "th-s -s a test". Look at the test data for further examples. ddd1RemoveLetter("The fox jumped", "i") → "The fox jumped" ddd1RemoveLetter("this is a test", "i") → "th-s -s a test" ddd1RemoveLetter("abcdefg", "c") → "ab-defg" ...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: 280
Copyright Nick Parlante 2017 - privacy