Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java string util if empty default

String emptyString = new String();    
result = StringUtils.defaultIfEmpty(emptyString, "default");
System.out.println(result);

String nullString = null;
result = StringUtils.defaultIfEmpty(nullString, "default");
System.out.println(result);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #string #util #empty #default
ADD COMMENT
Topic
Name
6+1 =