../
kernel
functions
add
all
apply_delta
assert
atan2
btn
btnp
camera
cd
char
chooser
circ
circfill
clip
cls
color
cos
count
cp
create_delta
create_gui
create_process
cursor
date
del
deli
env
error
exit
fetch
fetch_metadata
fget
fillp
foreach
fset
fstat
fullpath
get_clipboard
get_display
get_draw_target
get_spr
include
input
key
keyp
line
ls
map
max
memcpy
memmap
memset
menuitem
mget
mkdir
mouse
mouselock
mset
music
mv
note
on_event
open
oval
ovalfill
peek
peek2
peek4
peek8
peektext
pget
pid
pod
poke
poke2
poke4
poke8
printh
pset
pwd
readtext
rect
rectfill
rm
rrect
rrectfill
scoresub
send_message
set_clipboard
set_draw_target
set_spr
sfx
sin
socket
split
spr
sspr
stat
stop
store
store_metadata
sub
time
tokenoid
type
unmap
unpod
userdata
vec
vid
window
split(string,[seperator],[convert_numbers]): table
Overview
split converts the string string into a table, being seperated by the seperator [seperator].
Elements in the table are automatically converted into numbers if they are a number as a string (e.g: "2"); this can be disabled by settings [convert_numbers] to false.
This can also be used in the form of string:split([seperator],[convert_numbers]).
Arguments
string: string
The string to split into a table.
[seperator]: string|number
When seperator is a string, it splits the string each time it hits the seperator string.
When seperator is a number, the string is split into n-character groups.
[convert_numbers]: boolean
A truthy boolean of whether to convert number strings into numbers; defaults to true.
Returns
table: table
Returns the string split into a table.
Examples
Sourced from the Picotron Manual
?split("1,2,3,a,b") -- {1,2,3,"a","b"}
?split("one:two:3",":",false) -- {"one","two","3"}
?split("1,,2,") -- {1,"",2,""}