Skip to content

Instantly share code, notes, and snippets.

@rkhozinov
Created December 14, 2017 13:19
Show Gist options
  • Save rkhozinov/aa7891426fdd77c3987995c93e9e31c7 to your computer and use it in GitHub Desktop.
Save rkhozinov/aa7891426fdd77c3987995c93e9e31c7 to your computer and use it in GitHub Desktop.
public void RemoveStudent(string name, string lastname)
{
string _name = Student.FirstCapital(name);
string _lastname = Student.FirstCapital(lastname);
int index = 0;
foreach (Student student in Items)
{
if (student.Name == _name && student.Lastname == _lastname)
{
index = Items.IndexOf(student);
}
}
RemoveAt(index);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment