C Collections

cstring · Section 3

cstr_rfind

cstr_rfind - find the last occurrence of a substring

C Collections (libccollections, -lccollections)

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

This macro just forwards its arguments to cstring_rfind(). The search
starts from the end of the string and takes time linear in the length of
the string plus the length of needle; cstring_rfind(3) has the details.

s        cstr to search
needle   Substring to find

The zero-based index of the last occurrence, or ccol_invalid_size when
the needle is not found

cstring_rfind(3), cstr_find(3)