Skip to content

Instantly share code, notes, and snippets.

@jobscry
Created November 26, 2010 06:44
Show Gist options
  • Save jobscry/716358 to your computer and use it in GitHub Desktop.
Save jobscry/716358 to your computer and use it in GitHub Desktop.
String str; //string that has been provided
Char findeMe = 'a'; //character we're looking for
int count = 0; //number of times we found findMe
for(int i = 0; i < str.length(); i++) {
if(findMe.equals(str.charAt(i)))
count++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment