Results 1 to 2 of 2

Thread: How to parse a character separated string

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved How to parse a character separated string

    If I have a string separated by a special character like

    "string1;string2;string3;string4" etc.

    what is the easiest way to separate it into an array of strings so that I would have

    string str[4];

    and str[0] == "string1", str[1] == "string2" etc.

    ?
    Last edited by wey97; Nov 10th, 2004 at 09:40 AM.

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    this?
    PHP Code:
                string s="string1;string2;string3";
                
    string[] ss=s.Split(';'); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width