Java examples for java.lang:String Null Or Empty
is String Not Empty
import java.util.regex.Pattern; public class Main{ public static void main(String[] argv){ String string = "java2s.com"; System.out.println(isNotEmpty(string)); }/*from w ww . j a va 2s . co m*/ public static boolean isNotEmpty(String string) { return string != null && string.trim().length() > 0; } }