Log In  

This function is now available in PICO-8 0.2.1 - split()

Cart #split_string-0 | 2018-12-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

SPLIT_STRING is make a table with using a delimiter from string value.
There output the all value become string value in table.

split(string, delimiter, delimiter-2d)

a=split('1 a 20 split_test --------',' ')

for v in all(a) do

a=split('1 2 3;a b c;this is split',' ',';')
for b in all(a) do
    for v in all(b) do

P#59851 2018-12-09 09:45 ( Edited 2020-07-08 02:31)

:: sparr

Thanks for inspiring me to write this, which splits on any number of delimiters, producing a that-many-dimensional array: https://github.com/sparr/pico8lib/blob/master/strings.p8#L194

P#72867 2020-02-07 07:54

Is ...

a tuple!

I knew for the first time!!
Thank you for tell me!

P#73016 2020-02-12 13:55

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-07-09 15:32 | 0.016s | 4194k | Q:30