StrRemoveRange
- Macro
- August 22, 2025
Table of Contents
StrRemoveRange
StrRemoveRange
Description
Remove data from string in given range [start, start + count)
Parameters
Name | Direction | Description |
---|---|---|
str | in,out | Str to remove char from. |
rd | out | Where removed data will be stored. If not provided then it’s equivalent to deleting the chars in specified range. |
start | in | Index in string to removing chars from. |
count | in | Number of chars from starting index. |
Success
return
Failure
Does not return
Usage example (Cross-references)
- In
Str.Remove.c:93
:
// Test StrRemoveRange function
bool test_str_remove_range(void) {
printf("Testing StrRemoveRange\n");
Str s = StrInitFromZstr("Hello World");
- In
Str.Remove.c:102
:
// Remove a range of characters
StrRemoveRange(&s, buffer, 5, 5);
// Check that the characters were removed correctly
- In
Str.Remove.c:109
:
// 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