# How to split string into multiple chunks by size

**URL:** <https://forum.elixirforum.com/t/how-to-split-string-into-multiple-chunks-by-size/39662>\
**Category:** Questions\
**Tags:** strings\
**Created:** [May 13, 2021, 11:36am UTC](https://forum.elixirforum.com/t/how-to-split-string-into-multiple-chunks-by-size/39662 "2021-05-13T11:36:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![csokun](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/csokun/32/17661_2.png) [@csokun](https://forum.elixirforum.com/u/csokun)\
**Post date:** [May 13, 2021, 11:14pm UTC](https://forum.elixirforum.com/t/how-to-split-string-into-multiple-chunks-by-size/39662/4 "2021-05-13T23:14:09Z")

</div>

@hauleth I did a quick test and it seems like this method will throughway a leftover chunk.

> for \<\<chunk::size(5)-binary ← “hello world”\>\>, do: chunk  
> [“hello”, " worl"]

---

_[View the full topic](https://forum.elixirforum.com/t/how-to-split-string-into-multiple-chunks-by-size/39662)._
