It looks like you want something like:
var lines = text.Split(new[] { "\r\n" }, StringSplitOptions.None) .Select((line, index) => string.Format("<td>{0:00}</td><td>{1}</td>", index + 1, EscapeHtml(line)));
You will need to write EscapeHtml , though - you do not want the tags in your C # codec to end like tags in HTML anyway!
source share