============================================
* Original From: Paul Edwards, 3:711/934.9
* Original To : Frank Adam, 3:635/544
* Original Date: 1995-09-12 08:37
============================================
FA> Funny,i was just working on the same thing.The problem with my and your
FA> example is that it will replace the occurance of that string even if
FA> it's part of a word, E.g: Searching for "Tom" and
replacing it with "John"
FA> would make "Tomcat" "Johncat".Any ideas ? Even
searching for " Tom " would
FA> not fix it as if Tom happens to be the first or last word it would remain
FA> unchanged.
Other than writing the code, no.
FA> #include
FA> #include
FA> #include
FA> #include
What's this crap included for? It makes your program non-ISO.
FA> char* searchstr(char *str,char *search,char *replace)
FA> {
FA> if(!*str) return NULL;
FA> if(*search && *replace)
FA> {
FA> char *parts,*strtemp; // as in 'parts' of the string.
'//' are not valid C comments.
FA> Anyway for what it's worth this is mine.I'm only about a year old:) so
FA> gimme a break.This will actually replace all occurances.Can you spot any
FA> flows with it?
Only the above. BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|