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

 

gaurav.gupta@mq.edu.au strings > withoutFirstLast
prev  |  next  |  chance

Define a function that when passed a String, returns the String without the first AND the last characters. See the test cases about what to do when there are less than 2 characters in the String.


withoutFirstLast("Hello") → "ell"
withoutFirstLast("$") → ""
withoutFirstLast("Taxicab number 1729") → "axicab number 172"

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

String withoutFirstLast(String s) { }

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: 2 Post-solution available

Copyright Nick Parlante 2017 - privacy