From ccfef3a4f82ce48facde6499c53e62ab1065cd8b Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 1 Jun 2022 21:57:03 +0200 Subject: Change: Split replace into two: cstr_replace(s, search, repl), cstr_replace_from(s, pos, search, repl): matches cstr_find() + cstr_find_from(). --- examples/demos.c | 2 +- examples/utf8replace_c.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/demos.c b/examples/demos.c index 04d579db..7c5b9a4b 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(&cs, 0, "seven", "four"); + cstr_replace(&cs, "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/utf8replace_c.c b/examples/utf8replace_c.c index 27f33761..c38b37e4 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(&hello, 0, "🐨", "ø"); + cstr_replace(&hello, "🐨", "ø"); printf("%s\n", cstr_str(&hello)); c_foreach (c, cstr, hello) -- cgit v1.2.3