在所有段落标记内插入字体标记或使用字体标记在段落标记内包装文本(ASP.NET)

时间:2013-08-02 11:33:01

标签: asp.net vb.net c#-4.0 vb.net-2010

我有一个字符串变量,其值如下所示。只是一些HTML内容。

 <p>Lorem Ipsum is simpl...</p> 
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the in...</p> 
<p>Lorem Ipsum i...</p> <p>Lorem Ipygutyu...</p> <p>Lorem Ipsum is simtyu...</p>

我必须使用像这样的字体标记在所有段落标记中包装文本

我怎样才能实现这个目标。结果应该是这样的

<p><font face="Arial">Lorem Ipsum idfg dfgs simpl...</font></p> 
<p><font face="Arial">Lorem Ipsum is simdfg pl...</font></p> 
<p><font face="Arial">Lorem Ipsum ert retreis simpl...</font></p> <p><font face="Arial">Lorem Ipsuertrem is simpl...</font></p> <p><font face="Arial">Lorem Ipsumfghfgh is simpl...</font></p>

1 个答案:

答案 0 :(得分:0)

试试这个:

yourtext = yourtext.Replace("<p>", "<p><font face=""Arial"">").Replace("</p>", "</font></p>")