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

 

dogrady-cunniff@ccboe.com stringreview > middleInitial
prev  |  next  |  chance

Given a String, str, extract the middle initial, if there is one, or return the String "none" if there is no middle initial.


middleInitial("Elmer D. Fudd") → "D"
middleInitial(" Martin L King") → "L"
middleInitial("Dinah Shore") → "none"

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

public String middleInitial(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: 150 Post-solution available

Copyright Nick Parlante 2017 - privacy