public static int length(CharSequence str) {

        return str == null ? 0 : str.length();
    }
get length of CharSequence
<p/>
<pre>
length(null) = 0;
length(\"\") = 0;
length(\"abc\") = 3;
</pre>

@param str str
@return if str is null or empty, return 0, else return {@link
CharSequence#length()}.
app/src/main/java/coder/prettygirls/util/StringUtil.java