diff options
| author | Tyge Løvset <[email protected]> | 2022-06-01 21:43:30 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-06-01 21:43:30 +0200 |
| commit | 89424a2ff3a46dbd82a6954f97a25f973e981c98 (patch) | |
| tree | 2b72d8066cebaa580c3686bf477456e10d3e37fc /examples | |
| parent | 239276667b547dc795678cf3ac3c28c5ccf72532 (diff) | |
| download | STC-modified-89424a2ff3a46dbd82a6954f97a25f973e981c98.tar.gz STC-modified-89424a2ff3a46dbd82a6954f97a25f973e981c98.zip | |
Renamed cstr_replace() => cstr_replace_at(), and cstr_replace_one() => cstr_replace(self, start, search, replace).
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/demos.c | 2 | ||||
| -rw-r--r-- | examples/replace.c | 6 | ||||
| -rw-r--r-- | examples/utf8replace_c.c | 2 |
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) |
