Re: extracting string

Discussion in 'C Programming' started by CBFalconer, Jun 26, 2003.

  1. CBFalconer

    CBFalconer Guest

    qazmlp wrote:
    >
    > const char* big = "abcdefgh123" ;
    > const char* small = "bcd" ;
    >
    > Now, I want to extract the remaining string from big, after the
    > small contents. That is the result string should have "efgh123".
    >
    > I am confused about how to do it ?


    char *p;

    if ((p = strstr(big, small))) p += strlen(small);

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
     
    CBFalconer, Jun 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. R
    Replies:
    2
    Views:
    550
    Jon A. Cruz
    Jul 25, 2003
  2. Mar Thomas

    Extracting a string

    Mar Thomas, Sep 26, 2003, in forum: Java
    Replies:
    9
    Views:
    405
    Tony Morris
    Jan 15, 2004
  3. Zoran Cutura

    Re: extracting string

    Zoran Cutura, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    739
    Zoran Cutura
    Jun 26, 2003
  4. Ben Pfaff

    Re: extracting string

    Ben Pfaff, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    705
    Ben Pfaff
    Jun 26, 2003
  5. Martien Verbruggen

    Re: extracting string

    Martien Verbruggen, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    745
    Martien Verbruggen
    Jun 26, 2003
Loading...

Share This Page