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

 

jebbert@volusia.k12.fl.us > strFindLtr
prev  |  next  |  chance

Find the index of the first occurrence of the 'target' character in 'str'. If the target character does not appear in the string, return -99 as an indication that the target character was not found. This problem is intended as practice with while loops, so please do not use any for loops.


strFindLtr("This is a test", "a") → 8
strFindLtr("This is a test", "z") → -99
strFindLtr("ALL CAPS", "a") → -99

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

public int strFindLtr(String str, char target) { }

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

Copyright Nick Parlante 2017 - privacy