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


String-2 > wordEnds
prev  |  next  |  chance

Given a string and a non-empty word string, return a string made of each char just before and just after every appearance of the word in the string. Ignore cases where there is no char before or after the word, and a char may be included twice if it is between two words.

wordEnds("abcXY123XYijk", "XY") → "c13i"
wordEnds("XY123XY", "XY") → "13"
wordEnds("XY1XY", "XY") → "11"

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

public String wordEnds(String str, String word) { }

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

Copyright Nick Parlante 2017 - privacy