StrLast

Table of Contents

StrLast

Description

Access last character in string

Usage example (Cross-references)

    // Test StrLast function
    bool test_str_last(void) {
    WriteFmt("Testing StrLast\n");
    
    Str s = StrInitFromZstr("Hello");
    
    // Get the last character
    char last = StrLast(&s);
    
    // Check that the character is correct
    case STR_LAST : {
    if (VecLen(str) > 0) {
    char last = StrLast(str);
    (void)last; // Suppress unused variable warning
    }

Share :