02-13-2004 12:08
What llParseList2String() isn't enough...

CODE
// The split function
list splitter(string bigstring, list splitval)
{
list holder = []; // The list that holds split strings
string temp; // Temp buffer
integer cntr = 0; // Counts the string

while (llGetSubString(bigstring, cntr, cntr) != "")
{
string singlec = llGetSubString(bigstring, cntr, cntr); // The individual character from bigstring
integer mcntr = 0; // Counts the values in splitval
integer yn = FALSE; // Decides what to do with the character

// llSay(0, singlec);

// As long as there are values in splitval, see if any of the match singlec
while (llList2String(splitval, mcntr) != "")
{
if (llList2String(splitval, mcntr) == singlec)
{
yn = TRUE;
}
mcntr++;
}

// If none of the splitval values were the same
if (yn == FALSE)
{
temp = temp + singlec;
}

// If they were
else if (yn == TRUE)
{
holder = holder + temp;
temp = "";
}

// Counter
cntr++;
}

// The last one
holder = holder + temp;
temp = "";

return holder;
}
_____________________
"All designers in SL need to be aware of the fact that there are now quite simple methods of complete texture theft in SL that are impossible to stop..." - Cristiano Midnight

Ad aspera per intelligentem prohibitus.