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

Java > String-2 > countHi
prev  |  next  |  chance

Return the number of times that the string "hi" appears anywhere in the given string.

countHi("abc hi ho") → 1
countHi("ABChi hi") → 2
countHi("hihi") → 2

...Save, Compile, Run         

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  CodingBat  >  String-2

Forget It! -- delete my code for this problem 206.0

Copyright Nick Parlante 2006-10 - privacy