title: How do I find the index of an undefined string in a List<T>
body: <p>It's my understanding that if I want to get the ID of an item in a list, I can do this:</p>
  
  <pre><code>private static void a()
  {
      List&lt;string&gt; list = new List&lt;string&gt; {"Box", "Gate", "Car"};
      Predicate&lt;string&gt; predicate = new Predicate&lt;string&gt;(getBoxId);
      int boxId = list.FindIndex(predicate);
  }
  
  private static bool getBoxId(string item)
  {
      return (item == "box");
  }
  </code></pre>
  
  <p>But what if I want to make the comparison dynamic? So instead of checking if item=="box", I want to pass in a user-entered string to the delegate, and check if item==searchString.</p>