MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / isBlank

Method isBlank

src/main/java/org/htmlunit/util/StringUtils.java:107–123  ·  view source on GitHub ↗

Tests if a CharSequence is null, empty, or contains only whitespace. @param s the CharSequence to check @return true if a CharSequence is null, empty, or contains only whitespace

(final CharSequence s)

Source from the content-addressed store, hash-verified

105 * @return true if a CharSequence is null, empty, or contains only whitespace
106 */
107 public static boolean isBlank(final CharSequence s) {
108 if (s == null) {
109 return true;
110 }
111
112 final int length = s.length();
113 if (length == 0) {
114 return true;
115 }
116
117 for (int i = 0; i < length; i++) {
118 if (!Character.isWhitespace(s.charAt(i))) {
119 return false;
120 }
121 }
122 return true;
123 }
124
125 /**
126 * Tests if a CharSequence is NOT null, empty, or contains only whitespace.

Callers 15

methodFirstLineMethod · 0.95
methodLastLineMethod · 0.95
isBlankMethod · 0.95
startWebAppEE8ServerMethod · 0.95
parseMethod · 0.95
setCookieMethod · 0.95
setHostnameMethod · 0.95
getValueMethod · 0.95
replaceStyleAttributeMethod · 0.95
doOnLoadMethod · 0.95

Calls 2

isWhitespaceMethod · 0.80
lengthMethod · 0.65

Tested by 4

methodFirstLineMethod · 0.76
methodLastLineMethod · 0.76
isBlankMethod · 0.76
startWebAppEE8ServerMethod · 0.76