Simple streaming parser to extract columns In reply to previous question I rewrote ColumnReader and would like more suggestions

using System;

namespace R2D.IO
{
    public sealed class LineReader
    {
        public string NewLine { get; set; }

        string _buffer = "";

        public void Parse(string text)
        {
            _buffer += text;

            var lastline = _buffer.LastIndexOf(NewLine);
            if (lastline == -1)
                return;

            var lines = _buffer.Substring(0, lastline).Split(NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            _buffer = _buffer.Substring(lastline);

            foreach (var line in lines)
                Receive(line);
        }

        public event Action&lt;string&gt; Receive = (line) =&gt; { };
    }

    public sealed class ColumnReader
    {
        public string Delimiter { get; set; }
        public string NewLine
        {
            get { return reader.NewLine; }
            set { reader.NewLine = value; }
        }

        private LineReader reader = new LineReader();

        public ColumnReader()
        {
            reader.Receive += (line) =&gt; Receive(line.Split(Delimiter.ToCharArray()));
        }

        public event Action&lt;string[]&gt; Receive = (columns) =&gt; { };
    }
}


My main use-case is reading lines from a SerialPort:

var parser = new IO.LineReader { NewLine = port.NewLine };
port.DataReceived += (o, e) =&gt; parser.Parse(port.ReadExisting());
parser.Receive += (line) =&gt; { };
You can use the Microsoft.VisualBasic.FileIO.TextFieldParser and attach the serial port to a StreamReader and use that as input for the TextFieldParser.