Groovy web console

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

Truthiness

Published 2 months ago by jaxzin
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def bTrue = true
def bFalse = false

def sTrue = 'true'
def sFalse = 'false'
def sNull = null as String

println 'bTrue is true:'  + (Boolean.valueOf(bTrue)  ? 'yes' : 'no')
println 'bFalse is true:' + (Boolean.valueOf(bFalse) ? 'yes' : 'no')
println 'sTrue is true:'  + (Boolean.valueOf(sTrue)  ? 'yes' : 'no')
println 'sFalse is true:' + (Boolean.valueOf(sFalse) ? 'yes' : 'no')
println 'sNull is true:'  + (Boolean.valueOf(sNull)  ? 'yes' : 'no')