What is the easiest way to do this?
The results should be:
1: one
2: two
3:
4:
5: five
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestLines8833
{
class Program
{
static void Main(string[] args)
{
List<string> lines = new List<string>();
lines.Add("");
lines.Add("one");
lines.Add("two");
lines.Add("");
lines.Add("");
lines.Add("five");
lines.Add("");
lines.Add("");
lines.TrimList();
}
}
public static class Helpers
{
public static List<string> TrimList(this List<string> list)
{
//???
}
}
}