Attualmente sto rimuovendo tag HTML dai campi all'interno di un database interno. Tutto è andato liscio, tranne che per trasformare i tag
in caratteri di nuova riga in testo normale.Parse <br> in testo chiaro nuovo paragrafo
vorrei convertire questo:
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.
per questo:
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.
Sto usando la seguente riga di codice per modificare il
ad un carattere di nuova riga:
value = value.Replace("<br>", Environment.NewLine).Trim();
Dopo aver eseguito questo codice, questo è ciò che viene salvato nel mio 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.
Se prendo il testo analizzato salvato nel mio database e lo incollo nel blocco note o Word ottengo solo un paragrafo anziché due.
È questo il modo corretto di gestirlo? Il database che sto utilizzando è SQL Server 2005.
Non posso rispondere alla tua domanda, ma devo complimentarti per quanto bene hai spiegato e documentato ciò che stai chiedendo. Così tanti n00bs si sarebbero fermati dopo il primo paragrafo ... – jlarson
Se si esegue il debug e si interrompe sulla linea prima di essere salvata nel database vedete 2 nuovi line marker nella stringa? – Tetraneutron
Grazie. Ho fatto il debug e l'interruzione prima e dopo il cambiamento. Quando guardo il testo nel debugger dopo che il codice è stato eseguito per rimuovere lo
, appare come dovrebbe, con due paragrafi. Dopo quella riga il valore viene salvato. Quindi ho eseguito una query per estrarre il valore dal database e incollarlo in Word 2003 ma ho visto solo un paragrafo. – Brownman98