-
-
Save cackyhk/7c969480fbb20e5a4de0872dbc2643bc to your computer and use it in GitHub Desktop.
안드로이드,JAVA에서 단어에 따라서 '을/를', '이/가','은/는' 구분하기
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class KoreanUtil { | |
| public static final String getComleteWordByJongsung(String name, String firstValue, String secondValue) { | |
| char lastName = name.charAt(name.length() - 1); | |
| // 한글의 제일 처음과 끝의 범위밖일 경우는 오류 | |
| if (lastName < 0xAC00 || lastName > 0xD7A3) { | |
| return name; | |
| } | |
| String seletedValue = (lastName - 0xAC00) % 28 > 0 ? firstValue : secondValue; | |
| return name+seletedValue; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment