StringUtils中isNotEmpty和isNotBlank的区别

1,isNotEmpty(str)等价于 str != null && str != "" && str.length > 0。

2,isNotBlank(str) 等价于 str != null && str != "" && str.length > 0 && str.trim().length > 0。

同理:

1,isEmpty 等价于 str == null && str == "" || str.length == 0。

2,isBlank 等价于 str == null && str == "" || str.length == 0 || str.trim().length == 0。

posted @ 2019-11-13 09:38  Java-Legend  阅读(270)  评论(0编辑  收藏  举报