private int countNum(final String str, final char ch){ int num = 0; if (str != null){ for(char i: str.toCharArray()){ if(i==ch){ ++num; } } } return num; }
private int countNum(final String str, final char ch){ int num = 0; if (str != null){ for(char i: str.toCharArray()){ if(i==ch){ ++num; } } } return num; }
转载于:https://www.cnblogs.com/wenlin-gk/p/9849679.html