boxscript-interperter/code/dep/string_split.bs

22 lines
610 B
Plaintext
Raw Normal View History

2022-11-27 02:16:48 +00:00
create_function(string_split_chr,boxId,string_split_chr_chr,{
box=box_create();
box2 = box_create();
split_str_chr_i = 0;
for(split_str_chr_i,box_len(boxId),split_str_chr_i+1,{
if(eq(box_getvalue(boxId,split_str_chr_i),string_split_chr_chr),{
if(box_len(box2),{
box_add(box,box2);
box2 = box_create();
},0);
},{
box_add(box2,box_getvalue(boxId,split_str_chr_i));
});
});
if(box_len(box2),{
box_add(box,box2);
box2 = box_create();
},0);
box;
});