added isEmpty method
This commit is contained in:
@ -87,4 +87,13 @@ public abstract class StringUtil {
|
|||||||
returnValue = returnValue.trim();
|
returnValue = returnValue.trim();
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns true, if given string is either null or a blank string
|
||||||
|
* @param s the string to check
|
||||||
|
* @return true, if s is either null or s.equals("")
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(String s) {
|
||||||
|
return (s != null) && (!s.equals (""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user