Groovy web console

subscribe to the feed Subscribe
to this
site

printNonEmptyString

Published 4 weeks ago by akutz
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def printNonEmptyString(String s) {
  if (s) {
    println(s)
  } else {
    println("s is empty")
  }
}

printNonEmptyString("")
printNonEmptyString("Hello, world.")