title: Evaluate boolean string expressions?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3422673/evaluating-a-math-expression-given-in-string-form">Evaluating a math expression given in string form</a>  </p>
  </blockquote>
  
  
  
  <p>How can I boolean evaluate a string containing bool expressions? Like:</p>
  
  <pre><code>String userVar[] = {"a = 1", "b = 1", "c = 0"};
  String expr = "a &amp; b &amp; c";
  boolean result = evaluate(expr); //would evaluate to false
  </code></pre>
  
  <p>The user should be able to define his own variables (<code>a = 1</code>), and define his own boolean expression (<code>a &amp; b &amp; c</code>). So I will have all expressions only as a string. How can I evaluate them?</p>