---
title: trim
description: Creates a trim transformation action.
source: /actions/trim/trim.ts
contributors:
  - fabian-hiller
---

import { ApiList, Property } from '~/components';
import { properties } from './properties';

# trim

Creates a trim transformation action.

```ts
const Action = v.trim();
```

## Returns

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

## Examples

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

### Trimmed string

Schema to trim the start and end of a string.

```ts
const StringSchema = v.pipe(v.string(), v.trim());
```

## Related

The following APIs can be combined with `trim`.

### Schemas

<ApiList items={['any', 'custom', 'string']} />

### Methods

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

### Utils

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