title: Check if element(s) count>0 in Selenium using Linq in C#
body: <p>I have id's like follows:</p>
  
  <pre><code>id='vat-code-A'
  
  id='vat-code-B'
  
  id='vat-code-c'
  
  id='vat-code-D'
  </code></pre>
  
  <p>I want to check if the above <code>element(s) count&gt;0</code>, which can be done using a for each loop. But, is there a way to perform the above requirement with Linq as below.</p>
  
  <pre><code> var codes = new List&lt;string&gt;() { "A", "B", "C", "D" };
   var vatElement = Driver.FindElements(By.Id($'vat-code-{codes .Select(x=&gt;x)}"));                    
          if (((vatCodeElement.Count()) &gt; 0) == true)
          {                
              return true;
          }
  </code></pre>