| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflstr.h" char * strunique ( char *string, char unique)
Reduces chains of some character to a single instances. For example: replace multiple spaces by one space. Returns string.
{ char *from, *to; ASSERT (string); if (strnull (string)) return (string); /* Get rid of special cases */ from = string + 1; to = string; while (*from) { if (*from == unique && *to == unique) from++; else *++to = *from++; } *++to = '\0'; return (string); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |