Groovy web console

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

Strings

Published 3 months ago by Sgrecu
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
String message = "message"
String emptyMessage = ""
String spacesEmptyMessage = "     "

def x = 0, y=0, z=0

if (message) {
  x = 1
}

if (!emptyMessage){
  y = 2
}

if (!spacesEmptyMessage.trim()) {
 z = 3
}

[x: x, y: y, z: z]