public static int appearNumber(String srcText, String findText) { int count = 0; int index = 0; while ((index = srcText.indexOf(findText, index)) != -1) { index = index + findText.length(); count++; } return count; }
public static int appearNumber(String srcText, String findText) { int count = 0; int index = 0; while ((index = srcText.indexOf(findText, index)) != -1) { index = index + findText.length(); count++; } return count; }