#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Rochester, NY
    Posts
    21
    Rep Power
    0

    Anybody know how to tokenize a string and...


    and store it in an ArrayList?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0
    You either
    A) use a foreach with stringname.Split('char')
    or
    B) store in an array like array[] = stringname.Split('char') then pass off each element to the arraylist, maybe in a for(x<array.Count) ArrayList[x] = array[x];

    I think the syntax for foreach is:
    ArrayList a = new ArrayList();
    String strtok = "String to tokenize";
    foreach (String test = strtoke.Split(' '))
    a.Add(test);

    Or something to that extent, that should get you in the right direction.

    Regards,
    John
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Rochester, NY
    Posts
    21
    Rep Power
    0
    Yeah that's it, thanks.

IMN logo majestic logo threadwatch logo seochat tools logo