string-helpers.c: add str_starts_with()

This commit is contained in:
Johan Malm 2024-08-20 17:59:46 +01:00 committed by Johan Malm
parent 5db953aa89
commit 2446c46069
5 changed files with 45 additions and 7 deletions

View file

@ -73,4 +73,12 @@ char *str_join(const char *const parts[],
*/
bool str_endswith(const char *const string, const char *const suffix);
/**
* str_starts_with - indicate whether a string starts with a given character
* @string: string to test
* @needle: character to expect in string
* @ignore_chars: characters to ignore at start such as space and "\t"
*/
bool str_starts_with(const char *s, char needle, const char *ignore_chars);
#endif /* LABWC_STRING_HELPERS_H */