Skip to content
StrRemoveRange

StrRemoveRange

Description

Remove count characters starting at start and optionally copy them into rd. Pass NULL for rd to discard. See VecRemoveRange for the full SUCCESS/FAILURE contract.

Usage example (Cross-references)

Usage examples (Cross-references)
    // Test StrRemoveRange function
    bool test_str_remove_range(void) {
        WriteFmt("Testing StrRemoveRange\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        // Remove a range of characters
        StrRemoveRange(&s, buffer, 5, 5);
    
        // Check that the characters were removed correctly
        // Remove another range without storing it - use a temporary buffer instead of NULL
        char ignored[2];
        StrRemoveRange(&s, ignored, 4, 2);
    
        // Check that the characters were removed
Last updated on