سوال اولتون از متد زیر استفاده کنید:
public bool StartWhitNumbers(string x)
{
bool d;
x = x.Substring(0, 1);
switch (x)
{
case "1": d = true;break;
case "2": d = true;break;
case "3": d = true;break;
case "4": d = true;break;
case "5": d = true;break;
case "6": d = true;break;
case "7": d = true;break;
case "8": d = true;break;
case "9": d = true;break;
case "0": d = true;break;
default:d = false;break;
}
return d;
}
string[] lineOfContents = File.ReadAllLines("c:/test.txt");
foreach (var line in lineOfContents)
{
string[] tokens = line.Split(',');
if(StartWhitNumbers(tokens[0])) comboBox1.Items.Add(tokens[0]);
}