public static int validateZone ( CharSequence zone ) { for ( int i = 0 ; i < zone . length ( ) ; i ++ ) { char c = zone . charAt ( i ) ; if ( c == IPAddress . PREFIX_LEN_SEPARATOR ) { return i ; } if ( c == IPv6Address . SEGMENT_SEPARATOR ) { return i ; } } return - 1 ; }
Returns the index of the first invalid character of the zone or - 1 if the zone is valid