|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflstr.h"
char *
deletestring (
char *strbuf,
char *strtodel,
int ignorecase)
Deletes all occurances of one string, in another string. Returns a pointer to head of the buffer. Submitted by Scott Beasley jscottb@infoave.com
{
char *offset;
ASSERT (strbuf);
ASSERT (strtodel);
offset = (char *)NULL;
while (*strbuf)
{
if (!ignorecase)
offset = stricstr (strbuf, strtodel);
else
offset = strstr (strbuf, strtodel);
if (offset)
{
strcpy (offset, (offset + strlen (strtodel))); /* NO OVERRUN */
}
else
break;
}
return strbuf;
}
| | << | < | > | >> |
|