code: public static int search(CharSequence chars, char c) {
          int count = 0;
          for (int i = 0; i < chars.length(); i++) {
              if (chars.charAt(i) == c) {
                  count++;
              }
          }
          return count;
      }
docs: Returns the number of times the specified character was found
  in the target string, or 0 if there is no specified character.
  
  @param chars the target string
  @param c the character to find
  @return the number of times the specified character was found