Last updated 2 years ago
Was this helpful?
Determine which type of language that the string contains
String str = "大家,!。驚いた彼は道を走っていった"; char [] charList = str.toCharArray(); for (char c : charList) { Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); System.out.println(ub); }
English mostly is Basic_Latin
Chinese mostly is CJK_UNIFIED_IDEOGRAPHS
Reference: