package test;
public class YuGiOh
{
public static void main ( String[] args )
{
String input = "java中怎么实现求字符串中某个字母出现的次数";
int count1 = (" " + input + " ").split ("中").length - 1;
int count2 = input.replaceAll ("[^中]", "").length ();
System.out.println (count1 == count2);
}
}