Development needs, judging garbled, Baidu a bit, basically are the same code
if (! Character.isletterordigit (c)) {This is problematic, Chinese characters are recognized as letters and numbers
Use: if (! ( Charutils.isasciialpha (c) | | Charutils.isasciinumeric (c))) {--to Apache's Lang package
Mark a moment:
Char c= ...;
Character.unicodeblock UB = Character.UnicodeBlock.of (c);
if (UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
|| UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A
|| UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B
|| UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C
|| UB = = Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D
|| UB = = Character.UnicodeBlock.CJK_COMPATIBILITY_FORMS
|| UB = = Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS
|| UB = = Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT
|| UB = = Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION
|| UB = = Character.UnicodeBlock.GENERAL_PUNCTUATION
|| UB = = Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS
|| UB = = Character.UnicodeBlock.VERTICAL_FORMS
Constant Description: http://lwjlaser.iteye.com/blog/963211
Java Judgment garbled