Add str_cut_until()
This commit is contained in:
6
common.c
6
common.c
@@ -65,6 +65,12 @@ transform_str (char *s, int (*tolower) (int c))
|
||||
*s = tolower (*s);
|
||||
}
|
||||
|
||||
static char *
|
||||
str_cut_until (const char *s, const char *alphabet)
|
||||
{
|
||||
return xstrndup (s, strcspn (s, alphabet));
|
||||
}
|
||||
|
||||
static void
|
||||
split_str (const char *s, char delimiter, struct str_vector *out)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user