Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: extracting string

Reply
Thread Tools

Re: extracting string

 
 
Ben Pfaff
Guest
Posts: n/a
 
      06-26-2003
(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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a string Mar Thomas Java 9 01-15-2004 04:54 AM
extracting integers from string R Java 2 07-25-2003 03:47 AM
Re: extracting string CBFalconer C Programming 0 06-26-2003 10:34 AM
Re: extracting string Martien Verbruggen C Programming 0 06-26-2003 05:58 AM
Re: extracting string Zoran Cutura C Programming 0 06-26-2003 05:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57