/// <summary>
        /// 关键字替换
        /// </summary>
        /// <param name="body"></param>
        /// <returns></returns>
        public string TagReplace(string body)
        {
            string[] begin = this.txtTagBegin.Text.Split('|');
            string[] end = this.txtTagEnd.Text.Split('|');
            string a = string.Empty, b = string.Empty;

            for (int i = 0; i < begin.Length; i++)
            {
                a = begin[i];//第一个关键字
                if (!string.IsNullOrEmpty(a))//不为空
                {
                    try
                    {
                        b = end[i];//替换字符为空
                    }
                    catch { }
                    body = body.Replace(a, b);
                }
            }
            return body;
        }

  

相关文章:

  • 2021-09-07
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-06-01
  • 2021-09-07
  • 2022-02-15
  • 2021-10-31
猜你喜欢
  • 2021-12-12
  • 2021-08-31
  • 2021-09-03
  • 2022-01-07
  • 2021-09-15
  • 2021-11-28
  • 2021-09-17
相关资源
相似解决方案