Android examples for java.lang:String Null or Empty
Return default String for empty string
public class Main{ public static final String EMPTY = ""; public static String defaultString(String string) { return defaultString(string, EMPTY); }//from w w w . j a v a2 s . c o m public static String defaultString(String string, String defaultString) { if (string == null) { return defaultString; } return string; } }