替换字符串第一次出现的某个字符

int tmp = allContent.IndexOf("<p>  "); //第一次出现的索引值
 int l = "<p>  ".Length;
allContent = allContent.Remove(tmp, l); //在该索引处删除110
allContent = allContent.Insert(tmp, "<p>"+cr);
                             

posted @ 2014-09-05 16:00  程序员徐坤  阅读(495)  评论(0编辑  收藏  举报