code: private int countChar(String string, char c) {
          int count = 0;
          final int max = string.length();
          for (int i = 0; i < max; i++) {
              if (c == string.charAt(i)) {
                  count++;
              }
          }
          return count;
      }
docs: Counts the number of times the character is present in the string.
  
  @param string the string to count the characters in
  @param c the character to count
  @return the number of times the character is present in the string