//AGK 2.0.19
#option_explicit
Test()
end
function Test()
local words as string[0]
words=Split("Hello,World,Yall!",",")
local i as integer
do
for i=0 to words.length
print(words[i])
next
if GetPointerPressed() then exit
sync()
loop
endfunction
function Split(text as string,delimiter as string)
local ret as string[0]
local index as integer, count as integer
count=CountStringTokens2 ( text, delimiter )
ret.length = count-1
for index=1 to count
ret[index-1]=GetStringToken2(text,delimiter,index)
next
endfunction ret
//AGK 2.0.19 //MR #option_explicit Test() end function Test() local w as string[0] w=Split("Hello,World,123",",") local i as integer do for i=0 to w.length-1 print(w[i]) next if GetPointerPressed() then exit sync() loop endfunction function Split(text as string,delimiter as string) local sp as string[0] local index as integer, count as integer count=CountStringTokens2 ( text, delimiter ) sp.length = count for index=1 to count sp[index-1]=GetStringToken2(text,delimiter,index) next endfunction sp