汉字转换拼音/五笔 帮助类

   /// <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

posted @ 2018-07-24 14:32  小魔女srn  阅读(296)  评论(0编辑  收藏  举报