title: Loop through list and "return" only if no matches
body: <p>I am trying to loop through a list of strings and check them against a single string. If nothing is found that matches then we need to exit the code.</p>
  
  <pre><code>// loadedObj.Settings contains the list of strings, can be any number of strings     
  foreach (var currentCheckBox in loadedObj.Settings.Where(currentCheckBox =&gt; currentCheckBox != null))
      {   
          // docTypeAlias is a single string that needs to be matched
          var docTypeAlias = sender.ContentType.Alias;
          // This is the current value of currentCheckBox
          var requiredTypeAlias = currentCheckBox;
          if (!requiredTypeAlias.Equals(docTypeAlias)) return;
      }
  </code></pre>
  
  <p>The code works fine if there is only 1 string in Settings, but as soon as you have multiple strings, if the first one doesn't match obviously the code exits too soon.</p>