如何判断字符串是否不为空串

如题所述

//java
String str = null;
if(str.isEmpty()){    //当str的长度为0时,返回true
    System.out.println("该字符串是空串");
}
温馨提示:答案为网友推荐,仅供参考
相似回答