I have a problem with arrays of strings.
public string[] Begin;
....
for (int i = 0; i < Int32.Parse(Areas); i++)
{
Begin[i] = text.Substring(j, 4);
}
It gives an System.NullReferenceException error.
But it works fine without an array:
public string Begin;
....
for (int i = 0; i < Int32.Parse(Areas); i++)
{
Begin = text.Substring(j, 4);
}
I just can't understand what is the difference and how can I fix it?