title: Searching in a List, for a string; C#
body: <p>I am trying to search a List of strings. I want to be able to return any found results that include information from a string. For example:</p>
  
  <p>(I already have a list with values)
  List <code>strings</code> contains</p>
  
  <blockquote>
    <p>"dog",<br>
    "cat",<br>
    "doghouse",<br>
    "doge",<br>
    "mouse"</p>
  </blockquote>
  
  <p>I want a way to check a string, for example:</p>
  
  <pre><code>string dog = "dog"
  </code></pre>
  
  <p>And return the values:</p>
  
  <blockquote>
    <p>"dog",<br>
    "doghouse",<br>
     "doge"</p>
  </blockquote>
  
  <p>This is what I have so far, at least the portion I need help on.</p>
  
  <p>Console.WriteLine("What would you like to search for (Title: Full Title; Author: first, last): ");</p>
  
  <pre><code>                search = Console.ReadLine();
  
                  var results = bookList.Where(x =&gt; x.Contains(search)).ToList();
  
                  if (results != null)
  
                  {
  
                      Console.WriteLine(results);
  
                      //i--;
  
                      search = String.Empty;
  
                      clearvars results;
  
                      Console.WriteLine("Press Enter to continue");
  
                      Console.ReadLine();
  
                      continue;
  
                  }
  </code></pre>