C Collections

cstring · Section 3

cstr_split

cstr_split - split the string by a delimiter

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
cstr_split(s, delim, err);

This macro forwards its arguments to cstring_split(). It returns a cvec
of cstr tokens, and every token is a separate heap allocation.

s      cstr to split
delim  Delimiter string (must not be NULL or empty)
err    Optional pointer to receive an error string on failure

cvec of cstr tokens on success, NULL on failure

You must destroy every cstr in the vector and then the vector itself

cstring_split(3), cstr_find(3), cstr_substring(3)