拼音首字母排序

写在model里,实体类里。

public string FirstName
{
get
{
return string.IsNullOrEmpty(this.Name) ? "" : Net.Sourceforge.Pinyin4j.PinyinHelper.ToHanyuPinyinString(this.Name, new Net.Sourceforge.Pinyin4j.Format.HanyuPinyinOutputFormat(), " ").ToCharArray()[0].ToString().ToUpper();
}
}

原文地址:https://www.cnblogs.com/ahlx/p/5226673.html