eq
, ecq
—
string equality test.
countchar
,
countchar2
, countstr
—
count characters and strings within the string.
replace
,
replace_detach
,
limittextwidth
—
miscellaneous text functions.
#include <strfunc.h>
Equality test:
int
eq
(const
char *a, const char
*b);
Case-insensitive equality test:
int
ecq
(const
char *a, const char
*b);
Count the number of specified character within the string:
int
countchar
(const
char *string, char
what2countChar);
Count the number of specified characters within the string:
int
countchar2
(const
char *string, char
*what2countSet);
Count the number of specified little strings within the big
string:
int
countstr
(const
char *string, char
*what2countString);
Replace the substring:
char *
replace
(char
*string, char
*what, char
*to);
char *
replace_detach
();
Limit text width by inserting line breaks:
char *
limittextwidth
(char
*text, size_t
width);
eq
() and ecq
() function are just
short names for
!strcmp(3)
and
!strcasecmp(3)
countchar
() and
countchar2
() both used to compute the number of
specified character's occurences within the specified string.
countstr
() used to compute the number of little
string's occurences within the big string.
replace
() replaces the occurences of
string what to the specified string
to and able to do it when invoked recursive. The
string is stored inside the library and if you want it to be completely
yours, call replace_detach
().
limittextwidth
() ALTERS the source string,
inserting the newlines ('\n') to break the long lines. Long line is the line
which is more then width characters in length.
Lev Walkin <vlm@lionet.info>