/// <summary> /// 转换字符串成拼音 /// </summary> /// <param name="str"></param> /// <param name="type">转换为全部小写 1首字母大写 2只取第一个字母</param> /// <returns></returns> public static string GetPinYin(this string str, char type) { string pinyin = Chs2py.convert(str, type); return(pinyin); }
public static string GetPinYin(this string str) { string pinyin = Chs2py.convert(str, '0'); return(pinyin); }