I keep getting the error in title. I am not very experienced in coding and am not great at reading code and understanding it yet.
I also know this will be a simple fix but still I don't know what or where I need to fix.
using System;
using System.Linq;
namespace Day_6
{
class Program
{
static void Main(string[] args)
{
int numStrings = Convert.ToInt32(Console.ReadLine());
var str = "";
string[] words = new string[1000];
var even = new string[500];
var odd = new string[500];
for (int i = 0; i < numStrings; i++)
{
str = Console.ReadLine();
words.Append(str);
}
foreach (var word in words)
{
foreach (var letter in word)
{
if (word.IndexOf(letter)%2 != 0)
{
odd.Append(letter.ToString());
}
else
{
even.Append(letter.ToString());
}
}
Console.WriteLine(odd + " " + even);
}
}
}
}
Any help, even if it is just material to read so I can understand why/what/where I am getting this error would be great.
After all I am trying to learn!
Many thanks