Fixed whitespace removal bug for Windows.

As Windows Line separator is \r\n removing \n first was leaving \r in

I Created a single static method to do the compare.
Then fixed it to first removed line.separator
The other white space characters.