public class Text {
Java one character judging all is Chinese including punctuation
Private static Final Boolean Ischinese (char c) {
Character.unicodeblock UB = Character.UnicodeBlock.of (c);
if (UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
|| UB = = Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS
|| UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A
|| UB = = Character.UnicodeBlock.GENERAL_PUNCTUATION
|| UB = = Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION
|| UB = = Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) {
return true;
}
return false;
}
public static void Main (string[] args) {
System.out.println (Ischinese ('? ‘));
System.out.println (Ischinese ('! ‘));
System.out.println (Ischinese (', '));
System.out.println (Ischinese ('. ‘));
System.out.println (Ischinese (';'));
System.out.println (Ischinese (' Stay '));
}
}
"Java" in Java to determine whether a character contains Chinese characters, including Chinese punctuation