Skip to content

StrFirst

StrFirst

Description

Access first character in string

Usage example (Cross-references)

Usage examples (Cross-references)
            case STR_FIRST : {
                if (VecLen(str) > 0) {
                    char first = StrFirst(str);
                    (void)first; // Suppress unused variable warning
                }
    // 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
Last updated on