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

 

String-1 > withoutX2
prev  |  next  |  chance

Given a string, if one or both of the first 2 chars is 'x', return the string without those 'x' chars, and otherwise return the string unchanged. This is a little harder than it looks.


withoutX2("xHi") → "Hi"
withoutX2("Hxi") → "Hi"
withoutX2("Hi") → "Hi"

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

public String withoutX2(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: 199.0

Copyright Nick Parlante 2017 - privacy