I don't know if the chart of the hero, yes ~~
Public class letter {private static string _fromencode_ = "gbk"; private static string _toencode_ = "gbk"; public letter () {}
public static int compare (String str1, String str2) {int result = 0; String m_s1 = null, m_s2 = null; try {m_s1 = new String (str1.getBytes (_FromEncode _), _ ToEncode_); m_s2 = new String (str2. getBytes (_FROMENCODE_), _ toEncode_);} catCH (Exception E) {Return str1.compareto (STR2);} result = ChineseCompareto (m_s1, m_s2); returnrate;}
Public static int getcharcode (string s) {if (s == null && s.equals (")) Return -1; Byte [] b = s.getbytes (); int value = 0; for (int i = 0 i Public Static Int ChineseCompareto (String S1, String S2) {INT LEN1 = S1.LENGTH (); int LEN2 = S2.LENGTH (); int N = math.min (len1, len2); for (int i = 0; i PUBLIC STATIC STRING GETBEGINCHARACTER (STRING RES) {String A = Res; String Result = ""; String Current; For (int i = 0; i 0) Result = "k"; Else IF (Current, "Hit")> 0) Result = "J"; Else IF (Letter.comPare (Current, "Ha")> = 0) Result = "h"; Else IF (Current, "")> = 0) Result = "g"; Else IF (Current, "Send")> = 0) Result = "f"; Else IF (CURRENT, "Moth")> = 0) Result = "E"; Else IF (Current, "Take")> = 0) Result = "D "; Else IF (Current," Rub ")> = 0) Result =" C "; Else IF (Letter.comPare (Current," Bar ")> = 0) Result =" B "; Else IF (Current, "ah")> = 0) Result = "a";}} returnrate.touppercase ();} public static void main (String [] args) {letter lt = new Letter (); If (Lt.getBeginCharacter ("Test"). Equals ("CS"))) System.out.Println ("Successed!");}}