title: c# check if list contains an existing element (not null)
body: <p>Is there some equivalent to <code>myTestList.Count</code> that will only count not-nullable fields?</p>
  
  <p>For example I want to do certain things when I know that between some null elements is one existing element.</p>
  
  <p>This is the behaviour I want, but can this be achieved also with pre-existing functions?</p>
  
  <pre><code>if(myList.Count &gt; 0){
      for(int i = 0; i &lt; myList.Count; i++){
          if(myList[i] != null){
              DoSomething();
              break;
          }
      }
  }
  </code></pre>