c# - Parse <br> to plain text new paragraph -


I am currently in the process of deleting html tags from fields within an internal database

I Winning: Spain stalled 35-game unbeaten strikes, Spanish were handed over with their first defeat since November 2006. The Americans are now proceeding to face the winner of the World Cup winner five times in the semi-final between South Africa and Brazil on Thursday to advance to the final Sunday. Brazil defeated Americans 3-0 in their last meeting in this tournament. & Lt; Br> & Lt; Br> In the final, however, the United States would be without midfielder Michael Bradley, who received a red card to handle hard in the 87th minute, this was the third such prohibition for Americans in the tournament. This was the only careless flaw on an otherwise nearly perfect evening.

In:

  This win halts Spain's 35-player unbeaten strike, which was the first defeat of Spanish since November 2006. The final was won by South Africa and Brazil on Thursday's semi-final winner, five times by World Cup champion Brazil defeating Americans in their last 3-0 match in the tournament. In the final, however, the United States would be without midfielder Michael Bradley, who received a red card to handle hard in the 87th minute, this was the third such prohibition for Americans in the tournament. This was the only careless flaw on an otherwise nearly perfect evening.  

I am using the following line of code to change the character of a new line:

  value = value.Replace ("& lt ; Br & gt; ", Environment. New Line). Trim ();  

After running that code, it has been saved in my database:

  Win prevents Spain's 35-game unstoppable rhythm, to Spanish Defeat your first defeat since November 2006. The Americans are now proceeding on the final Sunday to face the winners of Thursday's semi-final between South Africa and Brazil, five times the World Cup winners. Brazil defeated Americans 3-0 in their last meeting in this tournament. In the final, however, the United States would be without midfielder Michael Bradley, who received a red card to handle hard in the 87th minute, this was the third such prohibition for Americans in the tournament. This was the only careless flaw on an otherwise nearly perfect evening.  

If I save the parseed text in my database and paste it into Notepad or Word then I get a paragraph instead of two.

Is this the right way to deal with it? The database I am using is SQL Server 2005.

Based on your follow-up comment (when you debug it), it seems that the correct value At least the database is being sent properly.

This is probably not easy, but it is worth investigating ... When you say "run a query to pull the value" .. and paste it on the word ", you do the query What are you doing? Because I know that you do some queries using the SQL Server 2005 Management Studio in the default "Grid for results" view, it does not properly present new lines (I think that Replaced with spaces) ... if you get this "result for text" (or you get value from the database in your code and debug the return value), you will get a more accurate representation of the actual value , Will be complete with new lines ...


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -