public static String strip(String str) {
        return strip(str, null);
    }
<p>Strips whitespace from the start and end of a String.</p>

<p>This is similar to {@link #trim(String)} but removes whitespace.
Whitespace is defined by {@link Character#isWhitespace(char)}.</p>

<p>A {@code null} input String returns {@code null}.</p>

<pre>
StringUtils.strip(null)     = null
StringUtils.strip("")       = ""
StringUtils.strip("   ")    = ""
StringUtils.strip("abc")    = "abc"
StringUtils.strip("  abc")  = "abc"
StringUtils.strip("abc  ")  = "abc"
StringUtils.strip(" abc ")  = "abc"
StringUtils.strip(" ab c ") = "ab c"
</pre>

@param str  the String to remove whitespace from, may be null
@return the stripped String, {@code null} if null String input
android/android_framework/base/src/main/java/lang3/StringUtils.java