Let's say you have a text file that you read as a long line:
123 123 123 123 123 123
Usually you break it into lines like this (example in Unity3D),
List<string> lines = new List<string>( controlFile.text.Split(new string[] { "\r","\n" }, StringSplitOptions.RemoveEmptyEntries));
.NET offers an incredible amount of string magic, such as formatting and more.
I wonder if there is magic available to easily delete comments?
NOTE. Of course, this can be done using regex, etc. As SonerGönül points out, you can usefully make it with .Where and .StartsWith
My question is: is there any tool in the .NET universe string magic , which specifically “understands” and helps with comments .
Even if the expert’s answer is “definitely not,” that’s a useful answer.
Fatie source share