(AGK version: 2.0.19)
Submitted: 2016-06-10 16:15:43
//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
(AGK version: 2.0.19)
Submitted: 2022-06-27 03:53:45
//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
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.