<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [sanitize](./x-components.sanitize.md)

## sanitize() function

Sanitize characters from a given string.

**Signature:**

```typescript
sanitize: (str: string) => string
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

str


</td><td>

string


</td><td>

The string to remove unwanted characters.


</td></tr>
</tbody></table>

**Returns:**

string

The string without the unwanted characters.

