Skip to content

StrDelete

StrDelete

Description

Delete char at given index

Success

return

Failure

Does not return

Usage example (Cross-references)

Usage examples (Cross-references)
                if (VecLen(str) > 0 && *offset + 2 <= size) {
                    size_t idx = extract_u16(data, offset, size) % VecLen(str);
                    StrDelete(str, idx);
                }
                break;
    // Test StrDelete function
    bool test_str_delete(void) {
        WriteFmt("Testing StrDelete\n");
    
        Str s = StrInitFromZstr("Hello");
    
        // Delete a character from the middle
        StrDelete(&s, 2);
    
        // Check that the character was deleted
    
        // Delete another character
        StrDelete(&s, 1);
    
        // Check that the character was deleted
Last updated on