我有一个字符串变量,其值如下所示。只是一些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>
答案 0 :(得分:0)
试试这个:
yourtext = yourtext.Replace("<p>", "<p><font face=""Arial"">").Replace("</p>", "</font></p>")