summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/demos.c2
-rw-r--r--examples/replace.c6
-rw-r--r--examples/utf8replace_c.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/demos.c b/examples/demos.c
index a6b23bc4..04d579db 100644
--- a/examples/demos.c
+++ b/examples/demos.c
@@ -13,7 +13,7 @@ void stringdemo1()
cstr_erase_n(&cs, 7, 5); // -nine
printf("%s.\n", cstr_str(&cs));
- cstr_replace_one(&cs, 0, "seven", "four");
+ cstr_replace(&cs, 0, "seven", "four");
printf("%s.\n", cstr_str(&cs));
cstr_take(&cs, cstr_from_fmt("%s *** %s", cstr_str(&cs), cstr_str(&cs)));
diff --git a/examples/replace.c b/examples/replace.c
index a70fcc8e..eba8e813 100644
--- a/examples/replace.c
+++ b/examples/replace.c
@@ -16,15 +16,15 @@ int main ()
cstr_append(&m, cstr_str(&m));
printf("%s\n", cstr_str(&m));
- cstr_replace(&s, 9, 5, s2); // "this is an example string." (1)
+ cstr_replace_at(&s, 9, 5, s2); // "this is an example string." (1)
printf("(1) %s\n", cstr_str(&s));
cstr_replace_n(&s, 19, 6, s3+7, 6); // "this is an example phrase." (2)
printf("(2) %s\n", cstr_str(&s));
- cstr_replace(&s, 8, 10, "just a"); // "this is just a phrase." (3)
+ cstr_replace_at(&s, 8, 10, "just a"); // "this is just a phrase." (3)
printf("(3) %s\n", cstr_str(&s));
cstr_replace_n(&s, 8, 6,"a shorty", 7); // "this is a short phrase." (4)
printf("(4) %s\n", cstr_str(&s));
- cstr_replace(&s, 22, 1, "!!!"); // "this is a short phrase!!!" (5)
+ cstr_replace_at(&s, 22, 1, "!!!"); // "this is a short phrase!!!" (5)
printf("(5) %s\n", cstr_str(&s));
}
}
diff --git a/examples/utf8replace_c.c b/examples/utf8replace_c.c
index 89d5375f..27f33761 100644
--- a/examples/utf8replace_c.c
+++ b/examples/utf8replace_c.c
@@ -13,7 +13,7 @@ int main() {
);
printf("%s\n", cstr_str(&hello));
- cstr_replace_one(&hello, 0, "🐨", "ø");
+ cstr_replace(&hello, 0, "🐨", "ø");
printf("%s\n", cstr_str(&hello));
c_foreach (c, cstr, hello)