I was searching the internet to see if I could find anything but I could not find anything, and unfortunately my knowledge is still low, which is why I came here again.
I tell you, I have a class library with a class called "professor" with its respective variables, and a class arrangement called "Duos" where I have a teacher-type array with their respective methods. I have a method to add " teacher "to the arrangement and also look for a" teacher "by the attribute rut.
method add:
public string AgregarProfesor(Profesor p)
{
if (buscar(p.Rut) == -1)
{
Array.Resize(ref _profesor, Profesor.Length + 1);
_profesor[Profesor.Length - 1] = p;
return "\n\nSe agregó nuevo profesor.";
}
return "\nEl Profesor ya existe, No se agregó.";
}
method search:
public int buscar(string rut)
{
for (int i = 0; i < _profesor.Length; i++)
{
if (Profesor[i].Rut == rut)
return i;
}
return -1;
}
}
I need to create a method which allows me to use the search method to find a teacher and remove it from the fix, but I have tried several things and searched the internet and the only thing I find is a list of fixes, all help is Welcome, thank you very much.