輸入漢字獲取漢字的首字母和全拼

2022-03-26 23:34:39 字數 671 閱讀 6456

//獲取漢字的首字母

public  string indexcode(string indextxt)

private string getoneindex(string oneindextxt)

", convert.toint16(gb2312bytes[0]) - 160)

+ string.format("", convert.toint16(gb2312bytes[1]) - 160)

));}

}//根據區位得到首字母

private string getx(int gbcode)

return " ";

}//獲取漢字的首字母和全拼

///

/// 獲取漢字的全拼音

///

/// 傳漢字的字串

/// 漢字的字串的拼音

public  string getspell(string x)

;string sa = new string

;byte b = new byte[2];

string s = "";

char c = x.tochararray();

for (int j = 0; j < c.length; j++)

else}}

}return s;

}

輸入漢字獲取漢字的首字母和全拼

獲取漢字的首字母 public string indexcode string indextxt private string getoneindex string oneindextxt convert.toint16 gb2312bytes 0 160 string.format convert...

獲取漢字的首字母和全拼

獲取漢字的首字母和全拼 public class chinesecode set 漢字的首字母 public string entxt set 構造方法 public chinesecode 構造方法,獲取漢字首字母拼音 public chinesecode string txt 獲取漢字的首字母 ...

獲取漢字拼音首字母

有個專案需要用到生成漢字的首字母,但從網上查了一下,對於多音字的處理都不是很好,所以就利用pinyin4j這個工具包自己寫了乙個。用到的jar包是pinyin4j 2.5.0.jar 獲取拼音首字母,多音字用逗號隔開 public static string getfirstspell string...