title: Substrings, searching lists
body: <p>I have a list which is being filled with user-entered strings. I've already checked that the string isn't empty, and that the list doesn't contain that string.</p>
  
  <p>Issue I'm having is I need to check if the user entered string is a sub-string of a stored string in the list.</p>
  
  <pre><code>List&lt;string&gt; stringlist = new List&lt;string&gt;();
  int index = 0;
  string userinput = null;
  
  while (userinput != "end")
  {
      userinput = getstring();
      if (stringlist.Contains(userinput))
      {
          Console.WriteLine(" Term has been stored previously.");
      }
      else
      {
          stringlist.Insert(index, userinput);
          index += 1;
      }
  
      foreach (string s in stringlist)
      {
          Console.WriteLine("List contains : {0}", s);
          if (s.Contains(userinput))
          {
              // something?
          }
      }
  } // end of main while loop
  </code></pre>
  
  <p>So basically, if a term someone enters is "dog", if one of the other strings entered is "bigdog", it should say "dog is a substring of bigdog" or something similar. Should I be making use of a different type of loop for this?</p>