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

Split string into constant number of substrings #58

Open
ezrosent opened this issue May 29, 2021 · 0 comments
Open

Split string into constant number of substrings #58

ezrosent opened this issue May 29, 2021 · 0 comments

Comments

@ezrosent
Copy link
Owner

Today, frawk supports awk-style splits that populate an array with all of the relevant sub-strings in an (optional) separator. It would be both more succinct and more efficient to support syntax like:

a, b = splitstr("hi:there", ":")

Or similar. Where, the behavior of splitstr compiles down to something like splitn with n given by the number of variables on the left-hand side of the assignment.

This would be particularly helpful when unpacking map keys that are punctuated by SUBSEP.

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

No branches or pull requests

1 participant