Quote:
|
Originally Posted by jake13jake
you seriously underestimate their usefulness... although, i did make a function that does it in a really really ugly sense... kindof taking advantage of how string lists are interpreted as arrays.
PHP Code:
function tokenizeWithDelims(string,delims) {
temp.list = "";
for (i=0; i<string.length(); i++) {
if (delims.pos(string.charat(i)) == -1)
temp.list @= string.charat(i);
else {
if (i != 0)
temp.list @= ",";
temp.list @= string.charat(i);
if (i != string.length()-1)
temp.list @= ",";
}
}
return temp.list;
}
|
Hold on a second.
Why don't you just do string.tokenize(delimiter)?