public static int count(final String string, final char c) {
    int counter = 0;

    for (int i = 0; i < string.length(); i++) {
      if (string.charAt(i) == c) {
        counter++;
      }
    }

    return counter;
  }
Counts how often a character appears in a given string.

@param string The string to search through.
@param c The character to search for.
@return Number of times the character appears in the string.
java/zylib/src/main/java/com/google/security/zynamics/zylib/strings/StringHelper.java