View Single Post
  #25  
Old 01-08-2006, 07:22 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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=0i<string.length(); i++) {
    if (
delims.pos(string.charat(i)) == -1)
      
temp.list @= string.charat(i);
    else {
      if (
!= 0)
        
temp.list @= ",";
      
temp.list @= string.charat(i);
      if (
!= string.length()-1)
        
temp.list @= ",";
    }
  }
  return 
temp.list;

Hold on a second.

Why don't you just do string.tokenize(delimiter)?
__________________
Skyld
Reply With Quote