Not operator is represented by !, it is used to evaluate
the boolean expressions.
HelloWorld.groovy
a = true if(!a){ println "a is evaluated to false" }else{ println "a is evaluated to true" } b = "" if(!b){ println "b is an empty string" }else{ println "b is not an empty string" }
Output
a is evaluated to true
b is an empty string
No comments:
Post a Comment