public static String trimToEmpty(String str) {
        return str == null ? EMPTY : str.trim();
    }
<p>Removes control characters (char &lt;= 32) from both
ends of this String returning an empty String ("") if the String
is empty ("") after the trim or if it is {@code null}.

<p>The String is trimmed using {@link String#trim()}.
Trim removes start and end characters &lt;= 32.
To strip whitespace use {@link #stripToEmpty(String)}.</p>

<pre>
StringUtils.trimToEmpty(null)          = ""
StringUtils.trimToEmpty("")            = ""
StringUtils.trimToEmpty("     ")       = ""
StringUtils.trimToEmpty("abc")         = "abc"
StringUtils.trimToEmpty("    abc    ") = "abc"
</pre>

@param str  the String to be trimmed, may be null
@return the trimmed String, or an empty String if {@code null} input
@since 2.0
android/android_framework/base/src/main/java/lang3/StringUtils.java