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

 

abraskin@mbusd.org 2016_practice_set_4 > findReplaceWith
prev  |  next  |  chance

Given a String parameter input, another String parameter find, and a third String parameter replaceWith return a String where the first occurrence of find has been replaced with replaceWith.

If the parameter find does not occur in the parameter input then return it unchanged.

findReplaceWith("I am here", "here", "there") → "I am there"
findReplaceWith("I am not there", "somewhere", "over there") → "I am not there"
findReplaceWith("I am there", "I am", "I'm") → "I'm there"

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

public String findReplaceWith(String input, String find, String replaceWith) { }

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: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy