提交 8e80f879 编写于 作者: H huming1

clean code for isBlank

上级 fe4f3b8d
package com.ctrip.framework.foundation.internals;
import com.google.common.base.Strings;
public class Utils {
public static boolean isBlank(String str) {
if (str == null || str.length() == 0) {
return true;
}
int length = str.length();
for (int i = 0; i < length; i++) {
char ch = str.charAt(i);
if (!Character.isWhitespace(ch)) {
return false;
}
}
return true;
return Strings.nullToEmpty(str).trim().isEmpty();
}
public static boolean isOSWindows() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册