StrEmpty
Description
Check whether string is empty.
Parameters
| Name | Direction | Description |
|---|---|---|
str |
in | String to query. |
Success
Returns true when string length is 0.
Failure
Returns false when the string contains at least one character. The string is not modified.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.Access.c:20:
// Test StrLen and StrEmpty functions
bool test_str_len_empty(void) {
WriteFmt("Testing StrLen and StrEmpty\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Access.c:27:
bool result = (StrLen(&s) == 0);
result = result && StrEmpty(&s);
StrPushBackR(&s, 'H');- In
Str.Access.c:33:
result = result && (StrLen(&s) == 2);
result = result && !StrEmpty(&s);
StrClear(&s);- In
Str.Access.c:37:
StrClear(&s);
result = result && (StrLen(&s) == 0);
result = result && StrEmpty(&s);
StrDeinit(&s);
Last updated on