title: Groovy - How to compare the string?
body: <p>how to compare the string which is passed as a parameter </p>
  
  <p>the following method is not working.       </p>
  
  <pre><code> String str = "saveMe"
  
   compareString(str)
  
   def compareString(String str){
      def str2 = "saveMe"
      if(str2==${str}){
        println "same"
      }else{
        println "not same"
      }
   }    
  </code></pre>
  
  <p>also tried </p>
  
  <pre><code> String str = "India"
  
   compareString(str)
  
   def compareString(String str){
     def str2 = "india"
     if( str2 == str ) {
       println "same"
     }else{
       println "not same"
     }
   }    
  </code></pre>