方法一: 最多人使用的一个方法, 直观, 方便, 但效率很低. 1:if(s == null || s.equals("")); 方法二: 比较字符串长度, 效率高, 是我知道的最好一个方法. 2:if(s == null || s.length() <= 0); 方法三: Java SE 6.0 才开始提供的方法, 效率和方法二几乎相等, 但出于兼容性考虑, 推荐使用方法 3:if(s == null || s.isEmpty());
转载于:https://my.oschina.net/hehongbo/blog/672956