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