본문 바로가기
java/method 정리

isAlphabetic()

by 일상코더 2022. 9. 28.

 

Determines if the specified character (Unicode code point) is an alphabet.
A character is considered to be alphabetic if its general category type, 
provided by getType(codePoint), is any of the following: or it has contributory
property Other_Alphabetic as defined by the Unicode Standard.
Params: codePoint – the character (Unicode code point) to be tested.
Returns: true if the character is a Unicode alphabet character, false otherwise.

 

특정 문자가 알파벳 인지 아닌지 결정한다. 


파라미터 : 테스트할 문자 (유니코드 코드 포인트)

리턴값 :  만약 문자가 유니코드 알파벳 문자이면 true 아니면 false

 

 

public static boolean isAlphabetic(int codePoint) {
        return (((((1 << Character.UPPERCASE_LETTER) |
            (1 << Character.LOWERCASE_LETTER) |
            (1 << Character.TITLECASE_LETTER) |
            (1 << Character.MODIFIER_LETTER) |
            (1 << Character.OTHER_LETTER) |
            (1 << Character.LETTER_NUMBER)) >> getType(codePoint)) & 1) != 0) ||
            CharacterData.of(codePoint).isOtherAlphabetic(codePoint);
    }

 

'java > method 정리' 카테고리의 다른 글

indexOf()  (0) 2022.09.27
valueOf()  (0) 2022.09.27
toCharArray()  (0) 2022.09.27
charAt()  (0) 2022.09.27

댓글