util/StringCompare: add StringEndsWithIgnoreCase(), StringStartsWithIgnoreCase()
This commit is contained in:
@@ -39,6 +39,18 @@ StringEndsWith(const wchar_t *haystack, const wchar_t *needle) noexcept
|
||||
StringIsEqual(haystack + haystack_length - needle_length, needle);
|
||||
}
|
||||
|
||||
bool
|
||||
StringEndsWithIgnoreCase(const wchar_t *haystack,
|
||||
const wchar_t *needle) noexcept
|
||||
{
|
||||
const size_t haystack_length = StringLength(haystack);
|
||||
const size_t needle_length = StringLength(needle);
|
||||
|
||||
return haystack_length >= needle_length &&
|
||||
StringIsEqualIgnoreCase(haystack + haystack_length - needle_length,
|
||||
needle);
|
||||
}
|
||||
|
||||
const wchar_t *
|
||||
FindStringSuffix(const wchar_t *p, const wchar_t *suffix) noexcept
|
||||
{
|
||||
|
Reference in New Issue
Block a user