This is blowing my mind right now, I don't know what I'm doing wrong. What I'm attempting to do is grab the contents of a textbox, splitting values separated by a comma, putting them into an array and then parsing them to float and put them into another array. System.NullReferenceException: Object reference not set to an instance of an object.
Xt = s1.Split(',').Select(s1V => s1V.Trim()).ToArray();
Yt = s2.Split(',').Select(s2V => s2V.Trim()).ToArray();
float number;
if (Xt.Length == Yt.Length)
{
int i = 0;
foreach (var value in Xt)
{
// Console.WriteLine("l:"+Xt.Length+" "+Xt[i]+"+");
if (Xt[i] != null)
{
Xi[i] = float.Parse(Xt[i]);
}
// Yi[i] = float.Parse(Yt[i]);
i++;
}
...