Groovy web console

subscribe to the feed Subscribe
to this
site
string to boolean (via #groovywebconsole)
tweet this snippet Tweet
this
script

string to boolean

Published 10 months ago by MU
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
foo = null
println "foo is '${foo}', and it evaluates to " + (foo ? 'true' : 'false')
foo = ''
println "foo is '${foo}', and it evaluates to " + (foo ? 'true' : 'false')
foo = 'not empty'
println "foo is '${foo}', and it evaluates to " + (foo ? 'true' : 'false')