* UCW Library -- String Routines
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
- * (c) 2007 Martin Mares <mj@ucw.cz>
+ * (c) 2007--2008 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
*dest = 0;
return start;
}
+
+uns
+str_count_char(const char *str, uns chr)
+{
+ const byte *s = str;
+ uns i = 0;
+ while (*s)
+ if (*s++ == chr)
+ i++;
+ return i;
+}
/* string.c */
char *str_format_flags(char *dest, const char *fmt, uns flags);
+uns str_count_char(const char *str, uns chr);
/* str-esc.c */