mirror of
https://github.com/labwc/labwc.git
synced 2025-11-07 13:30:06 -05:00
string-helpers.c: add str_starts_with()
This commit is contained in:
parent
5db953aa89
commit
2446c46069
5 changed files with 45 additions and 7 deletions
|
|
@ -170,3 +170,10 @@ str_endswith(const char *const string, const char *const suffix)
|
|||
|
||||
return strcmp(string + len_str - len_sfx, suffix) == 0;
|
||||
}
|
||||
|
||||
bool
|
||||
str_starts_with(const char *s, char needle, const char *ignore_chars)
|
||||
{
|
||||
return (s + strspn(s, ignore_chars))[0] == needle;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue