# Function: clip()

```ts
function clip(text, max): string;
```

Defined in: [packages/core/src/inbox/inbox.ts:106](https://github.com/leifriksheim/minca/blob/main/core/src/inbox/inbox.ts#L106)

Cuts text to at most `max` characters without splitting one (a surrogate pair stays whole)

## Parameters

| Parameter | Type |
| ------ | ------ |
| `text` | `string` |
| `max` | `number` |

## Returns

`string`
