> For the complete documentation index, see [llms.txt](https://docs.cheddar.vihan.org/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cheddar.vihan.org/docs/standard-library/string/chunk.md).

# Chunk

| type   | returns         |
| ------ | --------------- |
| Method | `array<string>` |

## Arguments

| name | type | description                           |
| ---- | ---- | ------------------------------------- |
| size | int  | Size of each chunk in resulting array |

## Explanation

Splits the given string into substrings of the given size.

## Examples

```swift
"1234".chunk(2) == ["12", "34"]
"Hello".chunk(3) == ["Hel", "lo"]
```
