Split function (Until there is a real Split function)

int split(string array[], string inString, string charSplit)
{
string tString = inString;
int i = 0;
int x = 0;

while(indexOf(tString, charSplit, 0) > 0)
{
i = indexOf(tString, charSplit, 0);

array[x] = substr(tString, 0, i);

tString = substr(tString, i + 1, strlen(tString));

x++;
}

array[x] = tString;
return x; // Size of array
}

Just pass into this function an array (It goes ByRef), the string which needs to be split and the char to split at.

I did testing of this in the Chellenge but couldn't in any other scripts so if anyone can test for me would be appricated :)

Thanks Silverlight for testing!

James