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
Recent comments
19 hours 10 min ago
1 day 2 hours ago
2 days 1 hour ago
3 days 19 hours ago
6 days 18 hours ago