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

 

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

The only string commands you can use for this method are: length, equals, substring, and charAt. You may use any non-string commands. Write a method that replaces the word "sunflower" with some other word. Only replace "sunflower" if it is all lower-case. Look at the test data for examples.


replaceSunflower1("The state flower of Kansas is the sunflower.", "rose") → "The state flower of Kansas is the rose."
replaceSunflower1("Once a sunflower, always a sunflower...", "tulip") → "Once a tulip, always a tulip..."
replaceSunflower1("sunflowersunflowersunflower", "hybiscus") → "hybiscushybiscushybiscus"

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

public String replaceSunflower1(String orig, String replacement) { }

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