#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15

    equivalent to PHP explode or PERL split


    Hi , with my C more than a little rusty :)


    how do I take a string and <php_version>explode()</php_version> it by a known delimiter?

    I am trying to do the following (pseudo-code)

    //where argv[1] is a string "value1::value2::value3"

    //php example'
    $bits= explode("::",argv[1]);

    put ( bundle, "CLIENTID", $bits[0]);
    put ( bundle, "CARDDATA", $bits[1]);
    put ( bundle, "CARDEXPIRYDATE", $bits[2]);
    //etc//


    any pointers appreciated
    resistance is no longer futile :: 423
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    USA
    Posts
    286
    Rep Power
    13
    strtok(), though it's not as easy to use. You basically pass it a set of delimiters and it breaks down the string into "tokens."
    Jon Sagara

    "Me fail English? That's unpossible!"

IMN logo majestic logo threadwatch logo seochat tools logo