我目前正在从内部数据库中的字段中删除html标记.除了将标签转换为纯文本换行符之外,一切都顺利进行.
我想转换一下:
The victory halted Spain’s 35-game unbeaten streak,handing the Spanish their first defeat since November 2006. The Americans now advance to the final Sunday to face the winner of Thursday’s semifinal between South Africa and Brazil,the five-time World Cup winner. Brazil defeated the Americans,3-0,in their earlier meeting in this tournament.<br> <br> In the final,though,the United States will be without midfielder Michael Bradley,who received a red card for a harsh tackle in the 87th minute,the third such ejection for the Americans in this tournament. It was the only careless blemish on an otherwise nearly perfect evening.
在这:
The victory halted Spain’s 35-game unbeaten streak,handing the Spanish their first defeat since November 2006. The Americans now advance to the final Sunday to face the winner of Thursday’s semifinal between South Africa and Brazil,in their earlier meeting in this tournament. In the final,the third such ejection for the Americans in this tournament. It was the only careless blemish on an otherwise nearly perfect evening.
我使用以下代码行将更改为新行字符:
value = value.Replace("<br>",Environment.NewLine).Trim();
The victory halted Spain's 35-game unbeaten streak,handing the Spanish their first defeat since November 2006. The Americans now advance to the final Sunday to face the winner of Thursday's semifinal between South Africa and Brazil,in their earlier meeting in this tournament. In the final,the third such ejection for the Americans in this tournament. It was the only careless blemish on an otherwise nearly perfect evening.
如果我将解析后的文本保存到我的数据库并将其粘贴到记事本或Word中,我只得到一个而不是两个.