you can use an extension method similar to the one below, and then your code will look like this:
var lines = operationText.ReadAsLines();
Implementation of the extension method:
public static IEnumerable<string> ReadAsLines(this string text) { TextReader reader = new StringReader(text); while(reader.Peek() >= 0) { yield return reader.ReadLine(); } }
I guess this is not as strong as the split option, which is usually very effective, but if that is not a problem ...
Rune fs
source share