I have a file that is supposed to be \n\n delimited, but of course its not. Some of the lines contains spaces after the \n\n. How do I find a remove all spaces after a \n\n that starts a new line but that is before any other character.
Sample:
\n\nData,Mo re,Data
\n\n Some,Li st,Of
\n\n\nOther,St uff
\n\n\n\n This is another
Desired Output
\n\nData,Mo re,Data
\n\nSome,Li st,Of
\n\nOther,St uff
\n\nThis is another
Regex is probably the answer, but I'm still learning regex. Here's more or less what I've come up with Regex.Replace(input,"^(\n{2,}\s*)", "\n\n")
but it doesn't work.
Edit: I should note that I pre-convert from various different line break encodings to \n
before this code is needed.