Java

Java isNotEmpty和isBlank区别

小樊
114
2024-07-18 15:29:29
栏目: 编程语言

  1. isNotEmpty:
String str = "hello";
if(StringUtils.isNotEmpty(str)){
    System.out.println("String is not empty");
} else {
    System.out.println("String is empty");
}
  1. isBlank:
String str = "   ";
if(StringUtils.isBlank(str)){
    System.out.println("String is blank");
} else {
    System.out.println("String is not blank");
}

总结:

0
看了该问题的人还看了