Validates if a value is a specific length.