We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b49ae5 + bfba1d3 commit 2a8c3a2Copy full SHA for 2a8c3a2
apollo-core/src/main/java/com/ctrip/framework/foundation/internals/Utils.java
100644
100755
@@ -1,20 +1,10 @@
1
package com.ctrip.framework.foundation.internals;
2
3
+import com.google.common.base.Strings;
4
+
5
public class Utils {
6
public static boolean isBlank(String str) {
- if (str == null || str.length() == 0) {
- return true;
7
- }
8
-
9
- int length = str.length();
10
- for (int i = 0; i < length; i++) {
11
- char ch = str.charAt(i);
12
13
- if (!Character.isWhitespace(ch)) {
14
- return false;
15
16
17
+ return Strings.nullToEmpty(str).trim().isEmpty();
18
}
19
20
public static boolean isOSWindows() {
0 commit comments