jdk17 用 StringUtils判断空值

jdk17中判断空值的方法不再是,isEmpty()‌已是不推荐的方法
isEmpty()‌,isBlank()‌,isNotEmpty()‌,‌isNotBlank()‌ 

image

jdk17中改为了StringUtils.hasText()

public static boolean hasText(@Nullable String str) {
return (str != null && !str.isBlank());
}
posted @ 2026-06-10 17:47  狗艳艳花  阅读(3)  评论(0)    收藏  举报