[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [trim](./js-utils.trim.md)
## trim() function
Signature:
```typescript
export declare function trim(val: string, max: number, tail?: string): string;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| val | string
| |
| max | number
| |
| tail | string
| |
Returns:
`string`