奥礼网
新记
如何判断string是否为空
如题所述
举报该文章
相关建议 2016-12-25
解决方法如下:
/**
* 判断字符串是否为空
* @param str 字符串
* @return 是否为空
*/
public static boolean isEmptyString(String str)
{
return str == null || str.trim().length() == 0;
}
温馨提示:内容为网友见解,仅供参考
当前网址:
https://aolonic.com/aa/nk3dg1d5415gw51a3n.html
其他看法
无其他回答
相似回答
大家正在搜
相关问题
Java如何判断String为空和不为空
java中如何判断String中的内容是否为数字
如何判断jquery 是否为空
如何判断一个String字符是否在string数组里
js怎么判断string是否相等
oracle sql 怎么判断是否为空
java判断string是不是数字
python怎么判断numpy.ndarray 是否空