Re: extracting string

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

  1. Ben Pfaff

    Ben Pfaff Guest

    (qazmlp) writes:

    > 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".


    If you are sure that `small' is present in `big':
    const char *remainder = strstr (big, small) + strlen (small);
    --
    "The way I see it, an intelligent person who disagrees with me is
    probably the most important person I'll interact with on any given
    day."
    --Billy Chambless
    Ben Pfaff, 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:
    510
    Jon A. Cruz
    Jul 25, 2003
  2. Mar Thomas

    Extracting a string

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

    Re: extracting string

    Zoran Cutura, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    703
    Zoran Cutura
    Jun 26, 2003
  4. Martien Verbruggen

    Re: extracting string

    Martien Verbruggen, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    712
    Martien Verbruggen
    Jun 26, 2003
  5. CBFalconer

    Re: extracting string

    CBFalconer, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    696
    CBFalconer
    Jun 26, 2003
Loading...

Share This Page