C Collections

cstring · Section 3

cstring_ends_with

cstring_ends_with - check whether the string ends with a suffix

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
bool cstring_ends_with(cstr s, const char *suffix);

This function tells whether the content of s ends with suffix. An empty
suffix always matches.

s        String to test
suffix   Suffix to look for

true if the string ends with suffix
false if the string does not end with suffix, or if suffix is NULL

Asserts if s is NULL

cstring_starts_with(3), cstring_rfind(3)