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

 

abraskin@mbusd.org 2020_ced_u2_practice > firstHalf
prev  |  next  |  chance

Given a String parameter return the first half of the String.


Strings with an odd length should NOT include the middle character.

firstHalf("HalfFirst") → "Half"
firstHalf("12345678") → "1234"
firstHalf("ABC123") → "ABC"

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

public String firstHalf(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: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy