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
print(v)
end

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



1

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


Is ...

a tuple!

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



[Please log in to post a comment]