public static int lastIndexOfNonWhiteSpace( String string )
    {
        if ( isEmpty( string ) ) {
            return 0;
        }
        int right = string.length();
        char[] chars = string.toCharArray();
        for ( int idx = right - 1; idx > 0; idx-- ) {
            char eachChar = chars[idx];
            if ( eachChar != ' ' && eachChar != '\t' ) {
                break;
            }
            right--;
        }
        return right;
    }