title: How to check if a List in a ViewBag contains string
body: <p>I have a ViewBag that is a list which i create in the controller:</p>
  
  <pre><code> List&lt;string&gt; listoflists = new List&lt;string&gt;();
  </code></pre>
  
  <p>it then gets filled with some string like for example:</p>
  
  <pre><code>listoflists.Add("java");
  listoflists.Add("php");
  listoflists.Add("C#");
  </code></pre>
  
  <p>Adding it to the ViewBag:
      ViewBag.listoflists = listoflists;</p>
  
  <p>i then would like to check in my View if this contains a specific string:</p>
  
  <pre><code>@if(ViewBag.listoflists.contains("java")
  {
  // do html stuff
  }
  </code></pre>
  
  <p>but when running this i get the following error:</p>
  
  <p><strong>System.Collections.Generic.List does not contain a definition for contains</strong></p>
  
  <p>What am i doing wrong, or how should i check if a list contains something in the View?</p>