hanguleam/extractor

Values

pub fn get_choseong(word: String) -> String

Extracts the initial consonants (choseong) from Korean Hangul characters in a string. Non-Korean characters are filtered out, while whitespace characters (spaces, tabs, newlines) are preserved in their original positions.

Examples

get_choseong("사과")
// -> "ㅅㄱ"

get_choseong("띄어 쓰기")
// -> "ㄸㅇ ㅆㄱ"

get_choseong("안녕hello")
// -> "ㅇㄴ"
Search Document