StrFirst
- Macro
- October 8, 2025
Table of Contents
StrFirst
StrFirst
Description
Access first character in string
Usage example (Cross-references)
- In
Str.Access.c:20
:
// Test StrFirst function
bool test_str_first(void) {
WriteFmt("Testing StrFirst\n");
Str s = StrInitFromZstr("Hello");
- In
Str.Access.c:25
:
// Get the first character
char first = StrFirst(&s);
// Check that the character is correct
- In
Str.c:98
:
case STR_FIRST : {
if (VecLen(str) > 0) {
char first = StrFirst(str);
(void)first; // Suppress unused variable warning
}