> ## Documentation Index
> Fetch the complete documentation index at: https://kk-83bff226.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# truncateString

> Truncates a string to a specified maximum length and appends '...' if the string was truncated.

## Signature

```typescript path=null start=null theme={null}
truncateString(str: string, maxLength: number): string
```

## Parameters

* **str**: `string` - The string to truncate.
* **maxLength**: `number` - The maximum length of the string after truncation.

## Returns

`string` - The truncated string, or the original string if it was shorter than the maximum length.

## Source

Defined in [string.ts:53](https://github.com/koji/ichigyou/blob/main/src/string.ts#L53)
