String splitting

It would be really handy to have a “split” operation that could break a text into a list based on an arbitrary string of text as a delimiter.

It would also be nice to be able to access regex capture groups as a list as well.

8 Likes

I can’t tell you how many times this capability would have saved me from ridiculous hoop jumping!

The concept is simple. It would basically mirror the functionality of the JS string split() method. A string goes in, and a list of texts comes out.

Perhaps it could be implemented as a :converted to list operator for strings. It seems like the perfect complement for the existing :join with operator for lists.

Could this be added to the list of ideas for the internal hackathon? PLEASE!

:smiley: :crossed_fingers:

5 Likes

2021, realizing this does not exist yet?

So how do we unserialize data?

2 Likes

We have this already.
We have :extract with regex
The pattern you need is
[^|]+

Where | is your delimiter. You could substitute comma or whatever you want in there. [^,]+

You then have a list of texts to do whatever you want with.

1 Like

Yes, regex is handy for that (and many other things), but it is not “no-code friendly”; and for such basic and frequently needed functionality, a native Bubble expression would be very welcome. Not only would it be easier to use, but it would make the Bubble expression more “readable”. It seems it would also be a great complement to this feature.

2 Likes