| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

deletestring

#include "sflstr.h"
char *
deletestring (
    char *strbuf,
    char *strtodel,
    int ignorecase)

Synopsis

Deletes all occurances of one string, in another string. Returns a pointer to head of the buffer. Submitted by Scott Beasley jscottb@infoave.com

Source Code - (sflstr.c)

{
   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;
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation