Skip to content

Instantly share code, notes, and snippets.

@synchrok
Created February 23, 2015 05:25
Show Gist options
  • Save synchrok/ee157f38cf7e9eb54dde to your computer and use it in GitHub Desktop.
Save synchrok/ee157f38cf7e9eb54dde to your computer and use it in GitHub Desktop.
public static class Utility {
public static bool Eulrlega(string word) {
var last = word[word.Length - 1];
if (last < 0xAC00)
return true;
last -= (char)0xAC00;
var jong = (char)((last % 28) + 0x11a7);
return (jong != 4519);
}
public static string GetEulrl(this string word) {
return Eulrlega(word) ? "을" : "를";
}
public static string GetEga(this string word) {
return Eulrlega(word) ? "이" : "가";
}
public static string GetEunnn(this string word) {
return Eulrlega(word) ? "은" : "는";
}
}
@synchrok
Copy link
Author

Usage:

        string itemName;

        itemName = "엘릭서";
        string.Format("{0}{1} 만드는데 필요한...", itemName, itemName.GetEulrl());
        Console.WriteLine("{0}{1} 만드는데 필요한...", itemName, itemName.GetEulrl());

        itemName = "포션";
        string.Format("{0}{1} 만드는데 필요한...", itemName, itemName.GetEulrl());
        Console.WriteLine("{0}{1} 만드는데 필요한...", itemName, itemName.GetEulrl());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment