is there a built in function for string padding?
i also don't see a way to find the size of a string
looks like countUtf8Bytes
You probably want this:
https://github.com/roc-lang/unicode
https://roc-lang.github.io/unicode/CodePoint/#utf8Len
String length is weirder than it looks, and the byte count will be different than the character count for non-english languages. If you're only working with ascii then you get to mostly not think about it.
Edit: I just saw your other thread; for AOC byte length is probably fine (and maybe I'm telling you things you know :sweat_smile:)
For advent of code, I advice not using strings as the input
Just commit to List U8
. It is the most correct and what Roc really pushes you to work with
For Advent Of Code, you can checkout Hannes' ASCII package https://github.com/Hasnep/roc-ascii
Lot's of nice helpers there :heart:
Last updated: Jul 05 2025 at 12:14 UTC