| about | help | done | prefs | create account |
Java > String-2 > getSandwich
prev | next | chance
| A sandwich is two pieces of bread with something in between. Return the string that is between the first and last appearance of "bread" in the given string, or return the empty string "" if there are not two pieces of bread.
getSandwich("breadjambread") → "jam" getSandwich("xxbreadjambreadyy") → "jam" getSandwich("xxbreadyy") → "" ...Save, Compile, Run See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops |
Forget It! -- delete my code for this problem 245.0
Copyright Nick Parlante 2006-10 - privacy