protected void Page_Load(object sender, EventArgs e)
{
string s1 = "今天天气很晴朗很晴朗";//原始字符串
string split = "晴朗";//要合并的

int i = s1.IndexOf(split);//获取第一索引个要合并字符串的
s1=s1.Replace(split, "");//替换为空
s1 = s1.Insert(i, split);//在一个处插入合并字符串

Page.RegisterStartupScript(
"", "<script>alert('" + s1 + "');</script>");
}

相关文章:

  • 2021-07-30
  • 2022-12-23
  • 2021-12-12
  • 2021-12-14
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-14
  • 2022-12-23
  • 2021-12-11
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案