StrContainsZstr
StrContainsZstr
Description
Check if string contains a null-terminated string.
Parameters
| Name | Direction | Description |
|---|---|---|
s |
in | Str object to search in. |
key |
in | Null-terminated string to search for. |
Success
true if a match exists.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.c:208:
}
bool StrContainsZstr(const Str *s, const char *key) {
return StrIndexOfZstr(s, key) != SIZE_MAX;
}- In
Str.Ops.c:99:
bool result = StrContains(&haystack, &needle);
result = result && StrContainsZstr(&haystack, "Hello");
result = result && StrContainsCstr(&haystack, "lo Wo", 5);
result = result && (StrIndexOf(&haystack, &needle) == 6);- In
Str.Ops.c:104:
result = result && (StrIndexOfZstr(&haystack, "Hello") == 0);
result = result && (StrIndexOfCstr(&haystack, "World", 5) == 6);
result = result && !StrContainsZstr(&haystack, "missing");
result = result && (StrIndexOfZstr(&haystack, "missing") == SIZE_MAX);
result = result && StrContainsZstr(&haystack, "");- In
Str.Ops.c:106:
result = result && !StrContainsZstr(&haystack, "missing");
result = result && (StrIndexOfZstr(&haystack, "missing") == SIZE_MAX);
result = result && StrContainsZstr(&haystack, "");
result = result && (StrIndexOfZstr(&haystack, "") == 0);
Last updated on