当前位置:网站首页>Notblank and notempty
Notblank and notempty
2022-07-01 23:30:00 【Jingling cat】
lang and lang3 In bag StringUtils The difference between
public interface CharSequence {
}
public final class String implements java.io.Serializable, Comparable<String>, CharSequence {
}
commons-lang Official documents


isEmpty series
isEmpty
StringUtils.isEmpty(null) = true
StringUtils.isEmpty("") = true
StringUtils.isEmpty(" ") = false // Note that there
StringUtils.isEmpty(“bob”) = false
StringUtils.isEmpty(" bob ") = false
public static boolean isEmpty(final CharSequence cs) {
return cs == null || cs.length() == 0;
}
isNotEmpty()
public static boolean isNotEmpty(final CharSequence cs) {
return !isEmpty(cs);
}
StringUtils.isAnyEmpty()
StringUtils.isAnyEmpty(null) = true
StringUtils.isAnyEmpty(null, “foo”) = true
StringUtils.isAnyEmpty("", “bar”) = true
StringUtils.isAnyEmpty(“bob”, “”) = true
StringUtils.isAnyEmpty(" bob ", null) = true
StringUtils.isAnyEmpty(" ", “bar”) = false
StringUtils.isAnyEmpty(“foo”, “bar”) = false
public static boolean isAnyEmpty(final CharSequence... css) {
if (ArrayUtils.isEmpty(css)) {
return true;
}
for (final CharSequence cs : css){
if (isEmpty(cs)) {
return true;
}
}
return false;
}
isNoneEmpty()
public static boolean isNoneEmpty(final CharSequence... css) {
}
isBank series
isBlank() Whether it is vacuum value ( Space or null value )
StringUtils.isBlank(null) = true
StringUtils.isBlank("") = true
StringUtils.isBlank(" ") = true // Note that there
StringUtils.isBlank(“bob”) = false
StringUtils.isBlank(" bob ") = false
public static boolean isBlank(final CharSequence cs) {
int strLen;
if (cs == null || (strLen = cs.length()) == 0) {
return true;
}
for (int i = 0; i < strLen; i++) {
if (Character.isWhitespace(cs.charAt(i)) == false) {
return false;
}
}
return true;
}
isNotBlank()
public static boolean isNotBlank(final CharSequence cs) {
return !isBlank(cs);
}
isAnyBlank()
StringUtils.isAnyBlank(null) = true
StringUtils.isAnyBlank(null, “foo”) = true
StringUtils.isAnyBlank(null, null) = true
StringUtils.isAnyBlank("", “bar”) = true
StringUtils.isAnyBlank(“bob”, “”) = true
StringUtils.isAnyBlank(" bob ", null) = true
StringUtils.isAnyBlank(" ", “bar”) = true
StringUtils.isAnyBlank(“foo”, “bar”) = false
public static boolean isAnyBlank(final CharSequence... css) {
if (ArrayUtils.isEmpty(css)) {
return true;
}
for (final CharSequence cs : css){
if (isBlank(cs)) {
return true;
}
}
return false;
}
isNoneBlank()
StringUtils.isNoneBlank(null) = false
StringUtils.isNoneBlank(null, “foo”) = false
StringUtils.isNoneBlank(null, null) = false
StringUtils.isNoneBlank("", “bar”) = false
StringUtils.isNoneBlank(“bob”, “”) = false
StringUtils.isNoneBlank(" bob ", null) = false
StringUtils.isNoneBlank(" ", “bar”) = false
StringUtils.isNoneBlank(“foo”, “bar”) = true
public static boolean isNoneBlank(final CharSequence... css) {
return !isAnyBlank(css);
}
Other methods


边栏推荐
- [applet] realize the left and right [sliding] list through the scroll view component
- Postgresql随手记(10)动态执行EXECUTING语法解析过程
- Development trend and future direction of neural network Internet of things
- CADD course learning (3) -- target drug interaction
- Redis数据类型和应用场景
- [micro service sentinel] sentinelresourceaspect details
- Is it safe to choose mobile phone for stock trading account opening in Shanghai?
- Create Ca and issue certificate through go language
- Matplotlib common charts
- mysql binlog的清理
猜你喜欢

Win 10 mstsc connect RemoteApp

问题随记 —— file /usr/share/mysql/charsets/README from install of MySQL-server-5.1.73-1.glibc23.x86_64 c

MT manager test skiing Adventure

【微服务|Sentinel】sentinel整合openfeign

Development trend and future direction of neural network Internet of things

mt管理器测试滑雪大冒险

会声会影2022智能、快速、简单的视频剪辑软件

Linux基础 —— CentOS7 离线安装 MySQL
![[micro service sentinel] sentinel integrates openfeign](/img/8b/46156255fd980eb422c7e05d5af7ee.png)
[micro service sentinel] sentinel integrates openfeign

SWT / anr problem - SWT causes kernel fuse deadlock
随机推荐
每日三题 6.30(2)
Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four
mt管理器测试滑雪大冒险
Matplotlib common charts
Postgresql随手记(10)动态执行EXECUTING语法解析过程
Is it safe to choose mobile phone for stock trading account opening in Shanghai?
Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term
上海炒股开户选择手机办理安全吗?
认识--Matplotlib
Win 10 mstsc connect RemoteApp
硅谷产品实战学习感触
距离度量 —— 汉明距离(Hamming Distance)
转行软件测试,知道这四点就够了!
[applet] realize the left and right [sliding] list through the scroll view component
Openresty load balancing
共享电商的背后: 共创、共生、共享、共富,共赢的共富精神
物联网开发零基础教程
神经网络物联网的发展趋势和未来方向
【C#】依赖注入及Autofac
力扣今日题-241. 为运算表达式设计优先级