I have a List of structs
List<Student> studentList = new List<Student>()
and I want to find a specific student, then update it's information. To do that I have the following code inside a method
Student tmpStudent = new Student();
tmpStudent.fName = txtFName.Text;
studentList.Find(i => i.fName == tmpStudent.fName).fName.Replace(tmpStudent.fName, "newName");
but the problem us that it doesn't seem to be working. When I show the contents of the list of structs I still have the old version
string tmp = "";
foreach (Student s in studentList)
{
tmp += s.fName + " " + s.lName + " " + s.Gpa.ToString() + "\n";
}
MessageBox.Show(tmp);
What is the correct way to achieve it?
Thanks