当前位置:网站首页>If function selection when determining whether it is empty

If function selection when determining whether it is empty

2022-06-10 00:37:00 Bobo

1. Default , At this time, the three situations will be judged as false:
1. The value is an empty string "" if (0) ==false
2. The value is null if (“”) ==false
3. The value is 0. if (null) ==false
All three cases will be judged as false
If Do not want the value to be 0 When is false have access to StringUtils.isEmpty() function
 Insert picture description here

Follow StringUtils.isEmpty The difference between :isEmpty() The empty string of the function is also judged as true
 Insert picture description here

原网站

版权声明
本文为[Bobo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206100009203351.html