StrInsert
- Macro
- August 22, 2025
Table of Contents
StrInsert
StrInsert
Description
Insert contents of str2
into str
at given index.
Parameters
Name | Direction | Description |
---|---|---|
str | in,out | Str object to insert into. |
str2 | in | Str object to be inserted. |
idx | in | Index to insert at. |
Success
return
Failure
Does not return
Usage example (Cross-references)
- In
Str.Insert.c:90
:
// Test StrInsert function
bool test_str_insert(void) {
printf("Testing StrInsert\n");
Str s1 = StrInitFromZstr("Hello");
- In
Str.Insert.c:96
:
// Insert s2 into s1 in the middle
StrInsert(&s1, &s2, 2);
// Check that the string was inserted correctly