isNotEmpty 和isNotBlank的区别【java字符串判空】

isNotEmpty(str)等价于 str != null && str.length > 0
isNotBlank(str) 等价于 str != null && str.length > 0 && str.trim().length > 0
同理
isEmpty 等价于 str == null || str.length == 0
isBlank  等价于 str == null || str.length == 0 || str.trim().length == 0

原文:
https://www.cnblogs.com/dixinyunpan/p/6088612.html

猜你喜欢

转载自blog.csdn.net/weixin_44407988/article/details/86519561