6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Java で文字種判定

6
Last updated at Posted at 2016-06-23
// Character.UnicodeBlock.BASIC_LATIN
Character.UnicodeBlock.of('a');
// Character.UnicodeBlock.HIRAGANA
Character.UnicodeBlock.of('あ');
// Character.UnicodeBlock.KATAKANA
Character.UnicodeBlock.of('ア');
// Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS
Character.UnicodeBlock.of('ア');
// Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
Character.UnicodeBlock.of('漢');
// Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS
Character.UnicodeBlock.of('A');
// Character.UnicodeBlock.HANGUL_JAMO
Character.UnicodeBlock.of('\u1100');

{
	char c = 'あ';

	if (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.HIRAGANA) {
		System.out.println("ひらがなです");
	} else {
		System.out.println("NOTひらがなです");
	}
}

6
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?