X39: getSandwich

A sandwich is two pieces of bread with something in between. Write a Java method that takes in a string str and returns the string that is between the first and last appearance of "bread" in str. Return the empty string "" if there are not two pieces of bread.

Your Answer:

Feedback

Your feedback will appear here when you check your answer.