code: public static int countChar(String s, char c) {
  
          int counter = 0;
          for (int i = 0; i < s.length(); i++) {
              if (s.charAt(i) == c) {
                  counter++;
              }
          }
          return counter;
      }
docs: Counts the occurrence of a given char in a given String.<p>
  
  @param s the string
  @param c the char to count
  
  @return returns the count of occurrences of a given char in a given String