title: How to compare a parsed string object within a predicate to the predicate string
body: <p>I have this code(heavily modified for your comfort):</p>
  <pre class="lang-cs prettyprint-override"><code>string password = Console.ReadLine();
  var checker = new Predicate&lt;string&gt;[] { (s) =&gt; s == password };
  string password2 = CompareStringAgainstPredicatesAndReturn(checker);
  </code></pre>
  <p>The predicate's purpose is to verify that password2 is the same as password. Yet I am getting the following error message:
  CS1628: Cannot use ref, out, or in parameter 'password' inside an anonymous method, lambda expression, query expression, or local function</p>
  <p>I don't know how to parse a variable to the predicate. So how would I go about doing this?</p>
  <p><em>Gonna point out one more time that this is not the actual code. The question is <strong>only</strong> regarding the actual predicate situation.</em></p>
  <p>As I was afraid, the lack of a complete code caused confusion and understandable misunderstandings. Therefore, here is the full code</p>
  <pre class="lang-cs prettyprint-override"><code>string password = BInput.GetPredicateString(
  new string[] { &quot;Choose your password&quot; },
  &quot;Password: &quot;, //Simply a prompt
  &quot;Your password needs to be between 8 to 30 characters long, contain at least 2 numbers and at least one special character&quot;, // Error message
  new Predicate&lt;string&gt;[] {
          (s) =&gt; s.Length &gt; 8,
          (s) =&gt; s.Length &lt; 30,
          (s) =&gt; s == password,
          (s) =&gt; Verificator.ContainsSpecialCharacter(s) //Not native
      }
  );
  </code></pre>
  <p>BInput.GetPredicateString will confirm that the returned string fulfills all requirements within the predicate. This is why the Predicate is an array.</p>
  <p>Hoping this brings more clarity, but it's fully possible it doesn't as I've been programming now for 14 hours and brain is like a soggy sponge.</p>
  <p>Best regards,</p>