Stream: beginners

Topic: Str functions


view this post on Zulip jeff.b (Jan 03 2024 at 10:25):

Hello Everybody,

Thank you for the Roc, it really rocks ;-).

I didn't find any functions to cut/take/add/pad number of characters from/to a string. Is the correct approach to convert string to list by List.graphemes, then add/remove chars into/from the list and then Str.joinWith x ""? Or am I missing something?

Thank you.

view this post on Zulip Luke Boswell (Jan 03 2024 at 11:00):

Richard just recently posted a draft string language guide which may be helpful.

view this post on Zulip Luke Boswell (Jan 03 2024 at 11:01):

Depending on what you are trying to do, you could use something like "hello" |> Str.concat ", world!" to combine two strings.


Last updated: Jul 05 2025 at 12:14 UTC