StrContainsCstr
StrContainsCstr
Description
Check if string contains a fixed-length string.
Parameters
| Name | Direction | Description |
|---|---|---|
s |
in | Str object to search in. |
key |
in | String to search for. |
key_len |
in | Length of searched string. |
Success
true if a match exists.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.c:179:
}
return StrContainsCstr(s, key->data, key->length);
}- In
Str.c:212:
}
bool StrContainsCstr(const Str *s, const char *key, size key_len) {
return StrIndexOfCstr(s, key, key_len) != SIZE_MAX;
}- In
Str.Ops.c:100:
bool result = StrContains(&haystack, &needle);
result = result && StrContainsZstr(&haystack, "Hello");
result = result && StrContainsCstr(&haystack, "lo Wo", 5);
result = result && (StrIndexOf(&haystack, &needle) == 6);
result = result && (StrIndexOfZstr(&haystack, "Hello") == 0);
Last updated on