StrFirst

Table of Contents

StrFirst

Description

Access first character in string

Usage example (Cross-references)

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

Share :