mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-11 04:54:06 +01:00
19 lines
352 B
Plaintext
19 lines
352 B
Plaintext
|
function string_splice(str, delim) {
|
||
|
var st = [];
|
||
|
var ss = str;
|
||
|
var sp;
|
||
|
|
||
|
do {
|
||
|
sp = string_pos(delim, ss);
|
||
|
|
||
|
if(sp == 0) {
|
||
|
if(ss != "") array_push(st, ss);
|
||
|
} else {
|
||
|
var _ss = string_copy(ss, 1, sp - 1);
|
||
|
if(_ss != "") array_push(st, _ss);
|
||
|
}
|
||
|
ss = string_copy(ss, sp + 1, string_length(ss) - sp);
|
||
|
} until(sp == 0);
|
||
|
|
||
|
return st;
|
||
|
}
|