title: How to compare strings in groovy script
body: <p>I cannot understand why my simple <code>String</code> equality test is returning false. </p>
  
  <p>Code is:</p>
  
  <pre><code>boolean isDevelopment() {
          //config.project_stage is set to "Development"
          String cfgvar = "${config.project_stage}" 
          String comp = "Development"
          assert cfgvar.equals(comp)
      }
  </code></pre>
  
  <p>Result is:</p>
  
  <pre><code>assert cfgvar.equals(comp)
         |      |      |
         |      false  Development
         Development 
  </code></pre>
  
  <p>I also get false if I do: </p>
  
  <pre><code>assert cfgvar == comp
  </code></pre>