# notLength

Creates a not length validation action.

```ts
const Action = v.notLength<TInput, TRequirement, TMessage>(
  requirement,
  message
);
```

## Generics

- `TInput` <Property {...properties.TInput} />
- `TRequirement` <Property {...properties.TRequirement} />
- `TMessage` <Property {...properties.TMessage} />

## Parameters

- `requirement` <Property {...properties.requirement} />
- `message` <Property {...properties.message} />

### Explanation

With `notLength` you can validate the length of a string or array. If the input does not match the `requirement`, you can use `message` to customize the error message.

## Returns

- `Action` <Property {...properties.Action} />

## Examples

The following examples show how `notLength` can be used.

### String schema

Schema to validate the length of a string.

```ts
const StringSchema = v.pipe(
  v.string(),
  v.notLength(8, 'The string must not be 8 characters long.')
);
```

### Array schema

Schema to validate the length of an array.

```ts
const ArraySchema = v.pipe(
  v.array(number()),
  v.notLength(10, 'The array must not contain 10 numbers.')
);
```

## Related

The following APIs can be combined with `notLength`.

### Schemas

<ApiList
  items={['any', 'array', 'custom', 'instance', 'string', 'tuple', 'unknown']}
/>

### Methods

<ApiList items={['pipe']} />

### Utils

<ApiList items={['isOfKind', 'isOfType']} />
