StrRemove
Description
Remove the character at idx and optionally store it; trailing characters shift one slot to the left. Pass NULL for chr to discard. idx must lie in [0, length). See VecRemove for the full SUCCESS/FAILURE contract.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.Remove.c:76:
// Test StrRemove function
bool test_str_remove(void) {
WriteFmt("Testing StrRemove\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Remove.c:84:
// Remove a character from the middle
char c;
StrRemove(&s, &c, 2);
// Check that the character was removed correctly
- In
Str.Remove.c:91:
// Remove another character without storing it - avoid passing NULL directly
char ignored;
StrRemove(&s, &ignored, 1);
// Check that the character was removed
Last updated on