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

 

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

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)

public String t050115reverseParts(String str, char revSymb) { }

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