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

 

davereed@creighton.edu csc222 > occurString
prev  |  next  |  chance

occurString() -- You are given a String and a character, and want to determine how many times that character occurs in the String. Your method should return that count.


occurString("apple", "a") → 1
occurString("apple", "e") → 1
occurString("apple", "p") → 2

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

public int occurString(String str, char ch) { }

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

Copyright Nick Parlante 2017 - privacy