I just try to check if an array contains a particular value or what is index of it not by showing respective values in brackets but typing them on textbox. How to go about that?
private void button3_Click(object sender, EventArgs e)
{
int[] values = new int[6];
values[0] = 2;
values[1] = 9;
values[2] = 5;
values[3] = 15;
values[4] = 8;
values[5] = 25
bool status = values.Contains(?);//I want to retrieve it from txtbox
label1.Text = $"{status}";
int indexi = Array.IndexOf(values,?); //same is true for this method aswell.
label2.Text = $"{indexi}";
foreach (int item in values)
{
listBox1.Items.Add(item);
}
}