/// <summary> /// 汉字转换拼音/五笔 帮助类 /// </summary> public static class ChsHelper { private static readonly ChsToLetter ChsToLetter; static ChsHelper() { if (ChsToLetter == null) { ChsToLetter = new ChsToLetter(); } } /// <summary> /// 获取汉字转义拼音字符串 /// </summary> /// <param name="strValue"></param> /// <param name="isUp">默认大写</param> /// <param name="full">默认缩写</param> /// <returns></returns> public static string ConvertToPy(this string strValue, bool isUp = true, bool full = false) { return ChsToLetter.GetPY(strValue, isUp, full); } /// <summary> /// 获取汉字转五笔字符串 /// </summary> /// <param name="strValue"></param> /// <param name="isUp">默认大写</param> /// <param name="full">默认缩写</param> /// <returns></returns> public static string ConvertToWb(this string strValue, bool isUp = true, bool full = false) { return ChsToLetter.GetWB(strValue, isUp, full); } }
引用 ChsHelper.dll