日期:2014-05-17 浏览次数:20572 次
/// <summary>
/// 拼音工具类
/// </summary>
public static class SpellHelper
{
/// <summary>
/// 获取汉字拼音[全拼]
/// </summary>
/// <param name="value">汉字串</param>
/// <returns>返回全拼</returns>
public static string GetSpell(string value)
{
return InnerGetSpell(value);
}
/// <summary>
/// 获取汉字拼音简码[简拼]
/// </summary>
/// <param name="value">汉字串</param>
/// <returns>返回简拼</returns>
public static string GetSpellFirst(string value)
{
return InnerGetSpellFirst(value).ToUpper();
}
/// <summary>
/// 获取拼音
/// </summary>
/// <param name="value">汉字串</param>
/// <param name="spellfirst">输出拼音简码</param>
/// <returns>返回全拼</returns>
public static string GetSpell(string value, out string spellfirst)
{
spellfirst = InnerGetSpellFirst(value);
string result = InnerGetSpell(value);
return result;
}
private static string InnerGetSpellFirst(string chineseString)