StrFindZstr
- Macro
- October 8, 2025
Table of Contents
StrFindZstr
StrFindZstrDescription
Find a key in a Str object.
Parameters
| Name | Direction | Description |
|---|---|---|
str | in | Str object to find str into. |
key | in | const char* string to look for |
Success
char* providing position of found string. Pointer is inside str.
Failure
NULL
Usage example (Cross-references)
- In
Str.Ops.c:56:
// Test string find functions
bool test_str_find(void) {
WriteFmt("Testing StrFindStr, StrFindZstr, and StrFindCstr\n");
Str haystack = StrInitFromZstr("Hello World");
- In
Str.Ops.c:76:
// Test StrFindZstr
const char *found4 = StrFindZstr(&haystack, "World");
result = result && (found4 != NULL && ZstrCompare(found4, "World") == 0);
- In
Str.c:230:
char *zstr = generate_cstring(data, offset, size, 10);
if (zstr) {
char *found = StrFindZstr(str, zstr);
(void)found; // Suppress unused variable warning
free(zstr);