我有这样一个带有html标记的字符串
<p>Go back nearly 30 000 years and you will find out (25)<u>ttt</u> carving painting and molding their visions of the world and (26)<u>ttt</u> into the rocky surfaces of Africa. As a (27)<u>ttt</u> David Colsens has spent years documenting the Art.<br />
We (28)<u>ttt</u> that the number of sites in Africa is well over a million you know It’s probably closer to five million. And if you think that each site could have (29)<u>ttt</u> of images you get some idea of the enormous extent of this art you know it is quite (30)<u>ttt</u>. Equally extraordinary experts say is how closly their thoughts and struggles mirror those (31)<u>ttt</u> today. <br />
They were trying to express their congnitive system. They were trying to look at the (32)<u>ttt</u> reality. They were looking at issues that were depiction of (33)<u>ttt</u> kinds of thoughts and all this together really reprensents the way they looked at their whole (34)<u>ttt</u>.</p>如何把字符串中的<u>ttt</u> 全部替换成一个文本框<asp:TextBox runat="server"></asp:TextBox>谢谢大家能不吝赐教
<p>Go back nearly 30 000 years and you will find out (25)<u>ttt</u> carving painting and molding their visions of the world and (26)<u>ttt</u> into the rocky surfaces of Africa. As a (27)<u>ttt</u> David Colsens has spent years documenting the Art.<br />
We (28)<u>ttt</u> that the number of sites in Africa is well over a million you know It’s probably closer to five million. And if you think that each site could have (29)<u>ttt</u> of images you get some idea of the enormous extent of this art you know it is quite (30)<u>ttt</u>. Equally extraordinary experts say is how closly their thoughts and struggles mirror those (31)<u>ttt</u> today. <br />
They were trying to express their congnitive system. They were trying to look at the (32)<u>ttt</u> reality. They were looking at issues that were depiction of (33)<u>ttt</u> kinds of thoughts and all this together really reprensents the way they looked at their whole (34)<u>ttt</u>.</p>如何把字符串中的<u>ttt</u> 全部替换成一个文本框<asp:TextBox runat="server"></asp:TextBox>谢谢大家能不吝赐教
如果要程序实现的话,可以把这段当成一段XML来整,替换节点,
也可以用正则找到你所需要的字符串,然后替换。。
str = Regex.Replace(str, pstr, "<asp:TextBox runat=\"server\"></asp:TextBox>");
试试?吃饭去了,没时间测试,不好意思.