将字符串中的分隔符替换为统一的英文逗号

代码
1 #region 将字符串中的分隔符替换为统一的英文逗号
2 public static string ReplaceDelimiters(string strNeiRong)
3 {
4 strNeiRong = strNeiRong.Replace(" ", ",");
5 strNeiRong = strNeiRong.Replace("", ",");
6 strNeiRong = strNeiRong.Replace("|", ",");
7 strNeiRong = strNeiRong.Replace("", ",");
8 return strNeiRong;
9 }
10 #endregion 将字符串中的分隔符替换为统一的英文逗号

调用代码

1 protected void btnAdd_Click(object sender, EventArgs e)
2 {
3 string yzname = this.txtoname.Text;
4
5 string str=StringPlus.ReplaceDelimiters(yzname);
6 this.Label3.Text = str;
7 }

 

 

 

相关文章:

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