C Collections

cstring · Section 3

cstr_replace

cstr_replace - replace all the occurrences of needle, and call ccol__fatal_err() on failure

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
cstr_replace(s, needle, replacement);

This macro calls cstring_replace(), and when that call gives anything
other than ccol_success it calls ccol__fatal_err().

s              cstr to change
needle         Substring to search for (must not be NULL or empty)
replacement    Substitute string (must not be NULL)

If you want to handle an error yourself, call cstring_replace() directly.

cstring_replace(3), cstr_find(3)