![]() |
Re: extracting string
qazmlp <qazmlp1209@rediffmail.com> 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 ? > > Please help! Thanks! strstr() is your friend. It will find your needle in the haystack, the returned pointer will point to the beginning of the needle, adding strlen(small) to that pointer will yield a pointer to the position after that substring. -- Z (Zoran.Cutura@daimlerchrysler.com) "LISP is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days." -- Eric S. Raymond |
| All times are GMT. The time now is 06:04 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.