about | help | code help+videos | done | prefs |
Write a method that returns a copy of the string 'str' but with all of the characters reversed between pairs of symbols that match 'revSymb'. The 'revSymb' will NOT be included in the new string. As a precondition you are guaranteed that there will be an even number of 'revSymb' symbols in the original string, although zero IS an even number, so that symbol might not occur at all. You are only allowed to use a restricted set of string methods. Those are: .length .charAt .substring .equals. Of course you can also create string variables, perform concatenation, and other built-in string functionality. t050115reverseParts("#This is a test#", "#") → "tset a si sihT" t050115reverseParts("What goes up #must# come #down#", "#") → "What goes up tsum come nwod" t050115reverseParts("What goes up 1must1 come 1down1", "1") → "What goes up tsum come nwod" ...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