I have the following string that I want to split on the "\n" but I need to remove/replace all of the occurances of multiple "\n\n";
Here is my sample string:
"\n01:05 PM\n901\nNew York Mets \n\n\n\n\n\n\n\n\n \n+125\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
So that I end up with an array like 1:05 PM 901 New York Mets +125
I've tried,
string adjRow = row.InnerText.Replace("\n", "");
Is there a single Regex Pattern that will work?
Added the following and seems to work.
RegexOptions options = RegexOptions.None;
Regex regex = new Regex("[\n]{2,}", options);
string adjRow = regex.Replace(tempRow, "\n");
Here is the result,
"\n01:05 PM\n901\nNew York Mets \n \n+128\n \nOv\n8½\n-113\no\n"