I'm doing a small program that does search within a vector. The problem I am having is that if it finds the name it gives a message saying it was found but then it gives another message saying that it was not found, the code I am creating is this:
string[] nomes = { "misael", "camila", "fernando" };
for (int i = 0; i < nomes.Length; i++) {
if (txtbusca.Text == nomes[i])
{
MessageBox.Show("nome encontrado");
}
}
for (int i = 0; i < nomes.Length; i++) {
if (txtbusca.Text != nomes[i])
{
MessageBox.Show("nome não encontrado");
}
}