Archive

Posts Tagged ‘Replace multiple line breaks’

RegEx to Replace multiple line breaks in Asp.net

October 4, 2010 Leave a comment

Suppose the text is

“Long Description

With

Multiple

Line

Breaks”

Mulitple line breaks can be replaced with regex as follows:

Regex.Replace(yourlongtext, "[\r\n]+", " - - ");