cn.cliveyuan.robin.base.util.RobinStrUtils Maven / Gradle / Ivy
/*
* Copyright (c) 2020 Clive Yuan ([email protected]).
*/
package cn.cliveyuan.robin.base.util;
/**
* @author Clive Yuan
* @date 2020/12/23
*/
public class RobinStrUtils {
public static final String EMPTY = "";
public static boolean isBlank(final CharSequence cs) {
final int strLen = length(cs);
if (strLen == 0) {
return true;
}
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(cs.charAt(i))) {
return false;
}
}
return true;
}
public static int length(final CharSequence cs) {
return cs == null ? 0 : cs.length();
}
public static boolean isNotBlank(final CharSequence cs) {
return !isBlank(cs);
}
}