title: Removing an element from list if it contains particular text in it
body: <p>I have a C# method in which I look for certain text say <code>username</code> in a list with element in the format <code>username + datetime</code> and if any part of text matches the element in the list, then the entire element has to be removed from the list</p>
  
  <p>Method to add to the <code>c# List</code></p>
  
  <pre><code>string active_user = model.UserName.ToString();
  string datetime = "(" + DateTime.Now + ")";
  List&lt;string&gt; activeUsers = new List&lt;string&gt;();
  
  if (activeUsers.Any(str =&gt; str.Contains(active_user)))
  {
      //do nothing
  }
  else
  {
      activeUsers.Add(active_user+datetime);
  }
  </code></pre>
  
  <p>Now I would like a method that deletes the element if it matches the username or any part of element something like</p>
  
  <pre><code>if (activeUsers.Contains(active_user))
  {
      activeUsers.Remove(active_user);
  }
  </code></pre>