/**implementation of the Textutils.isempty () method * Returns True if the string is null or 0-length.*@paramstr The string to be examined*@returntrue if STR is null or zero length*/ Public Static BooleanisEmpty (@Nullable charsequence str) {if(str = =NULL|| Str.length () = = 0) return true; Else return false; }
The default value for int is 0, and the default value for integer is null:
Java provides encapsulation classes for each primitive type, and integer is the wrapper class provided by Java for Int.
The default value for int is 0, and the default value for integer is null, that is, the difference between an unassigned and a value of 0 can be distinguished by an int, which cannot express an unassigned condition.
Simple Android int empty method:
int myInt = getInt (); if (Textutils.isempty (string.valueof (myInt))) {
The int of Java is sentenced to null:
int/ / getInt () may return empty! if (null = = string.valueof (myInt) && "". Equals (string.valueof (myInt)) { //}
Org.apache.commons.lang.StringUtils ~ This package cannot be referenced by default in Android!
If (! Stringutils.isempty (string.valueof (myInt))) { else { }
java/android int type How to empty?