Commit 2a8c3a24 by Jason Song Committed by GitHub

Merge pull request #753 from Acceml/huming

clean code for isBlank
parents 2b49ae56 bfba1d30
package com.ctrip.framework.foundation.internals; package com.ctrip.framework.foundation.internals;
import com.google.common.base.Strings;
public class Utils { public class Utils {
public static boolean isBlank(String str) { public static boolean isBlank(String str) {
if (str == null || str.length() == 0) { return Strings.nullToEmpty(str).trim().isEmpty();
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;
} }
public static boolean isOSWindows() { public static boolean isOSWindows() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment