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

 

crehwinkel@frhsd.com apcsa-exam-review-strings2 > replaceString
prev  |  next  |  chance

Write a method called replaceString, which is given three Strings as input parameters. The method should return the first String which was passed to the method with every occurrence of the second String replaced in the first String with the third String. For example removeString("Mississippi", "iss", "3") would return "M33ippi".


replaceString("Mississippi", "iss", "3") → "M33ippi"
replaceString("Honolulu", "o", "O") → "HOnOlulu"
replaceString("banana", "a", "ii") → "biiniinii"

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

public String replaceString(String s1, String pat, String repl){ }

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: 200

Copyright Nick Parlante 2017 - privacy