What i'm trying to do is read in a header row of a file to a combobox. Here is my code:
private void button4_Click(object sender, EventArgs e)
{
string[] startdelim = File.ReadAllLines(textBox1.Text);
int counter = 1;
foreach (string delim in startdelim)
{
if (counter == 1)
{
string removedelim = delim.Replace("\"", "");
string[] lines = removedelim.IndexOf(",");
foreach (string line in lines)
{
comboBox1.Items.Add(line);
}
}
counter++;
}
}
for some reason it keeps telling me
Error Cannot implicitly convert type 'int' to 'string[]' at
string[] lines = removedelim.IndexOf(",");