public string[] readTextFile()
{
string line = string.Empty;
int i = 0;
string[] result = new string[35];
using (System.IO.StreamReader file = new System.IO.StreamReader("c:\\test.txt"))
{
bool isFoundBangkok = false;
while ((line = file.ReadLine()) != null)
{
line = line.Trim();
if (line.Contains("BANGKOK"))
{
isFoundBangkok = true;
continue;
}
if (isFoundBangkok)
{
foreach (string li in line.Split(' '))
{
if (i > 34)
{
break;
}
result[i++] = li;
}
}
}
}
return result;
}