Ahhh.... so he wants to split the string by using another string as the delimiter...and store all the results
// Project: ExplodeFunction
// Created: 2019-03-13
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "ExplodeFunction" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
TestStr$ = "test1:test2:;test3;test4:;test5,test6...test7;:test8:;test9"
arr as string[]
arr = Explode(TestStr$,":;")
do
for i =0 to arr.length
print(arr[i])
next i
Print( ScreenFPS() )
Sync()
loop
function Explode(text as string,delimiter as string)
local sp as string[]
del = len(delimiter)
pos = findstring(text, delimiter)
while pos>0
res$ = left (text,pos-1)
sp.insert(res$)
text = right(text,len(text)-pos-del+1)
pos = findstring(text, delimiter)
endwhile
if len(text)>0 then sp.insert(text)
endfunction sp
^^This code does that ....the explode function breaks a long string into substrings separated by a delimiter string. Its not a complicated function really
Sometimes just finding what people want is the hard part.