title: How to delete all the specified contents from an object in a list in C#
body: <p>I have a list that looks like the following:</p>
  
  <pre><code>STUDENT: John, TEST ONE: A, TEST TWO: A, TEST THREE: D
  STUDENT: Greg, TEST ONE: F, TEST TWO: B, TEST THREE: D
  </code></pre>
  
  <p>How can I delete the data for a specific student once the user inputs the name?
  I've tried doing the following but it doesn't work:</p>
  
  <pre><code>List&lt;object&gt; list = new List&lt;object&gt;(); // contains the list of students that
                                         //  were appended
  </code></pre>
  
  <p>Then, inside of a method here is some of the code that I wrote:</p>
  
  <pre><code>Console.Write("Enter the name of the student you want to remove: ");
  string removedStudent = Console.ReadLine();
  list.RemoveAll(s =&gt; s == removedStudent);
  </code></pre>
  
  <p>When the code runs and I input <code>Greg</code> as the name of the student I want to remove, nothing happens. I print the list and Greg is still in the list. So, instead of printing like this:</p>
  
  <pre><code>STUDENT: John, TEST ONE: A, TEST TWO: A, TEST THREE: D
  </code></pre>
  
  <p>It still prints like:</p>
  
  <pre><code>STUDENT: John, TEST ONE: A, TEST TWO: A, TEST THREE: D
  STUDENT: Greg, TEST ONE: F, TEST TWO: B, TEST THREE: D
  </code></pre>
  
  <p>Is there a way I can delete the entire row just by specifying the name of the student?</p>
  
  <p>Edit:</p>
  
  <p>Here is the part where I ask the user to input the student information:</p>
  
  <pre><code>class StudentsIO
  {
      public object getInput()
      {
          Console.Write("Enter student name: ");
          string studentName = Console.ReadLine();
          Console.Write("Enter test 1 score: ");
          string test1 = Console.ReadLine();
          Console.Write("Enter test 2: ");
          string test2 = Console.ReadLine();
          Console.Write("Enter test 3: ");
          string test3 = Console.ReadLine()
          Students students = new Students(studentName,test1,test2,test3);
          return students;
      }
  }
  </code></pre>
  
  <p>Here's where I add students to the list:</p>
  
  <pre><code>StudentIO newStudent = new StudentIO();
  object studentList = newStudent.getInput();
  list.Add(studentList);
  </code></pre>