Add str_cut_until()

This commit is contained in:
2015-07-09 00:10:06 +02:00
parent d3b1754e14
commit f907f1e3dc
2 changed files with 10 additions and 6 deletions

View File

@@ -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)
{