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


String-1 > without2
prev  |  next  |  chance

Given a string, if a length 2 substring appears at both its beginning and end, return a string without the substring at the beginning, so "HelloHe" yields "lloHe". The substring may overlap with itself, so "Hi" yields "". Otherwise, return the original string unchanged.

without2("HelloHe") → "lloHe"
without2("HelloHi") → "HelloHi"
without2("Hi") → ""

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

public String without2(String str) { }

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

Copyright Nick Parlante 2017 - privacy