I am currently in the process of removing html tags from fields within an internal database. Everything has gone smoothly except for turning
tags to plain text new line characters.
I would like to convert this:
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.
in to this:
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.
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.
I am using the following line of code to change the
to a new line character:
value = value.Replace("<br>", Environment.NewLine).Trim();
After running that code this is what is saved in my database:
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. 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.
If I take the parsed text saved to my database and paste it into notepad or Word I get only one paragraph instead of two.
Is this the correct way to handle this? The database I am using is SQL Server 2005.