C Collections

cstring · Section 3

cstring_starts_with

cstring_starts_with - check whether the string begins with a prefix

C Collections (libccollections, -lccollections)

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

This function tells whether the content of s begins with prefix. An
empty prefix always matches.

s        String to test
prefix   Prefix to look for

true if the string starts with prefix
false if the string does not start with prefix, or if prefix is NULL

Asserts if s is NULL

cstring_ends_with(3), cstring_find(3)