public static int length(CharSequence cs) {
        return cs == null ? 0 : cs.length();
    }
Gets a CharSequence length or {@code 0} if the CharSequence is
{@code null}.

@param cs
           a CharSequence or {@code null}
@return CharSequence length or {@code 0} if the CharSequence is
        {@code null}.
@since 2.4
@since 3.0 Changed signature from length(String) to length(CharSequence)
android/android_framework/base/src/main/java/lang3/StringUtils.java