title: How to find the index of an object in a list of objects? VB.Net
body: <p>I am creating a method FindPerson which searches for a given name in a list of objects and returns the index in the list of the object with this name if found, otherwise it returns -1. </p>
  
  <pre><code>    Public Class TPerson
          Private Name As String
          Private Address As String
          Private Age As Integer
  
          Public Sub New()
              Name = "x"
              Address = "x"
              Age = 0
          End Sub
  
          ……
  
      End Class
  
  
      Public Class TGroup
           Private Group As List(Of TPerson)
           Private GroupSize As Integer
  
           Public Sub New(size As Integer)
               GroupSize = size
               Group = New List(Of TPerson)
           End Sub
  
  
           Public Sub FindPerson(findname As String)
              Dim index As Integer 
              index = Group.FindIndex(findname) 'error
           End Sub
       End Class
  </code></pre>
  
  <p>The output should be an index in the list, however when I run the program I get the error: BC30311  Value of type 'String' cannot be converted to 'Predicate(Of TPerson)'</p>
  
  <p>I am not quite sure how to fix this any help will be appreciated</p>