检查字符串是否不是null而不是空的
二手: if(str!= null && str.length()== 0)
option 3:trim()。isement(Isement()trim whitespace whitespace,使用trim(intrim(strim)iSempty if(Isempty()。 !str.trim().isEmpty())
Option 4: isBlank()
Java 11 introduced the isBlank() method, which combines the functionality of isEmpty() and trim():if (str != null && !str.isEmpty())if (str != null && !str.isblank())
handy function
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3