Im having a strange problem here , Im reading settings from a .txt file using the code which works like a charm .
private string[] splitArray;
private void Form1_Load(object sender, EventArgs e)
{
string[] lines = File.ReadAllLines("settings.txt");
foreach (string line in lines)
{
if (line == "" || line.StartsWith(" ") || line.StartsWith("/"))
{
continue;
}
splitArray = line.Split('=');
MessageBox.Show(splitArray[0]);
}
}
Whats strange is the value of splitArray[0] keeps changing meaning the items are being inserted at the start of the array not the end .
Is there any to make the contents of line.Split('='); be added to the end of the array ?