i have a problem in my java coding to count two characters of a string.
eg to count the letter "ou" in the string "How do you feel today?". The answer should be 5. but i still have error compiling it
here is my coding:
public int countCharset(String s, String cc)
s.equals("") ? 0 :
s.charAt(0) == cc ? 1 + countCharset(s.substring(1), cc) :
/*else*/ countCharset(s.substring(1), cc);
-> how can i make the char cc into string?