StrEndsWithCstr
- Function
- August 22, 2025
Table of Contents
StrEndsWithCstr
StrEndsWithCstr
Description
Check if string ends with a fixed-length C-style string (Cstr).
Parameters
Name | Direction | Description |
---|---|---|
s | in | Str to check. |
suffix | in | Pointer to suffix character array. |
suffix_len | in | Length of suffix. |
Success
Returns true if s
ends with suffix
.
Failure
Returns false.
Usage example (Cross-references)
- In
Str.c:208
:
}
bool StrEndsWithCstr(const Str* s, const char* suffix, size suffix_len) {
ValidateStr(s);
return ends_with(s->data, s->length, suffix, suffix_len);
- In
Str.Ops.c:117
:
// Test StrEndsWithCstr
result = result && StrEndsWithCstr(&s, "orld", 4);
result = result && !StrEndsWithCstr(&s, "ello", 4);
- In
Str.Ops.c:118
:
// Test StrEndsWithCstr
result = result && StrEndsWithCstr(&s, "orld", 4);
result = result && !StrEndsWithCstr(&s, "ello", 4);
StrDeinit(&s);