Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add string_split #1429

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Add string_split #1429

merged 4 commits into from
Dec 17, 2024

Conversation

7h3kk1d
Copy link
Contributor

@7h3kk1d 7h3kk1d commented Dec 5, 2024

New stdlib functions:

  • string_split : string -> string -> [string]

I also reformatted the tests for consistency.

Comment on lines 40 to 48
(str, sep) => {
Js_of_ocaml.(
Js.string(str)##split(Js.string(sep))
|> Js.str_array
|> Js.to_array
|> Array.to_list
|> List.map(Js.to_string)
);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to Str.regexp_string and Str.split

@7h3kk1d 7h3kk1d requested review from Negabinary and removed request for Negabinary December 5, 2024 14:43
@7h3kk1d 7h3kk1d changed the title Aoc stdlib improvements Add string_split Dec 10, 2024
@7h3kk1d 7h3kk1d requested a review from disconcision December 14, 2024 17:11
@7h3kk1d 7h3kk1d marked this pull request as ready for review December 14, 2024 17:11
@7h3kk1d 7h3kk1d requested a review from cyrus- December 17, 2024 15:04
@cyrus- cyrus- merged commit 82d39a9 into dev Dec 17, 2024
2 checks passed
@cyrus- cyrus- deleted the aoc_stdlib_improvements branch December 17, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants