I have a need to get rid of all line breaks that appear in my strings (coming from db). I do it using code below:
value.Replace(\"\\r\\n\", \"\").Replace(\"\\n\"
Props to Yossarian on this one, I think he's right. Replace all whitespace with a single space:
data = Regex.Replace(data, @"\s+", " ");