简体   繁体   English

在所有段落标签内插入字体标签或在带有字体标签(ASP.NET)的段落标签内包装文本

[英]insert font tag inside all paragraph tag or wrap text inside paragraph tag with font tag (ASP.NET)

I've a string variable with it value as follows. 我有一个字符串变量,其值如下。 Just some html content. 只是一些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>

I have to wrap text inside all the paragraph tags with a font tag like this 我必须用这样的字体标签将文本包装在所有段落标签中

How can I achive this. 我怎么能做到这一点。 The result should be like this 结果应该是这样的

<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>

尝试这个:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM