> 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/head.md).

# Head

| type   | returns  |
| ------ | -------- |
| method | `string` |

## Arguments

| name | type | description                      |
| ---- | ---- | -------------------------------- |
| size | int  | the amount of characters to grab |

## Explanation

Returns a substring of the given size, starting at the string's first index. Roughly equivilent to `#slice(0, size)`

## Examples

```swift
"Hello, World".head(5) == "Hello"
"Hi".head(3) == "Hi"
```
