Groovy String类型null和empty("")判断
public static void main(String[] args) { def a = "" def b = null if (a?.trim()){ //a为null/"" a?.trim()表达式为false println("not empty or null") } else { def c = a?.trim() ...