---
title: toSnakeCase
description: Creates a to snake case transformation action.
source: /actions/toSnakeCase/toSnakeCase.ts
contributors:
  - fabian-hiller
---

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

# toSnakeCase

Creates a to snake case transformation action.

Words are separated by `_`, `-` and ASCII whitespace, as well as by case and acronym boundaries.

> Acronym runs are normalized to lowercase (e.g. `parseURLValue` → `parse_url_value`) and digits stay attached to the preceding token (e.g. `item2Name` → `item2_name`).

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

## Returns

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

## Examples

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

### Snake case string

Schema that transforms a string to snake case.

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

## Related

The following APIs can be combined with `toSnakeCase`.

### Schemas

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

### Methods

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

### Utils

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