I need order a list in numerical order which contains strings with both numbers and words for example : "100 | Bob". Here is my code so far:
List<string> candidate = new List<string>();
candidate.Add("10 | Dave");
candidate.Add("200 | Bob");
candidate.Add("1000 | Larry");
candidate.Sort();
int i = 0;
while(i < candidate.Count)
{
Console.WriteLine(candidate[i]);
i++;
}
Console.ReadKey();
It currently outputs:
10 | Dave
1000 | Larry
200 | Bob
But I would like it to output:
10 | Dave
200 | Bob
1000 | Larry
any help or advice would be greatly appreciated. Thanks Jarvey.