From 7349441c0c95b21da87f1a13176ac4014ed98ea8 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 23 May 2022 14:44:05 +0200 Subject: Renamed cstr_find_n(self, search, pos, nmax) => cstr_find_from(self, pos, search), and cstr_replace_first(self, search, repl) => cstr_replace_first(self, pos, search, repl). // returns pos after replaced str. --- examples/cstr_match.c | 2 +- examples/demos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/cstr_match.c b/examples/cstr_match.c index 08236a0d..cd3f04be 100644 --- a/examples/cstr_match.c +++ b/examples/cstr_match.c @@ -4,7 +4,7 @@ int main() { c_autovar (cstr ss = cstr_new("The quick brown fox jumps over the lazy dog.JPG"), cstr_drop(&ss)) { - size_t pos = cstr_find_n(ss, "brown", 0, 5); + size_t pos = cstr_find_from(ss, 0, "brown"); printf("%" PRIuMAX " [%s]\n", pos, pos == cstr_npos ? "" : cstr_str(&ss) + pos); printf("equals: %d\n", cstr_equals(ss, "The quick brown fox jumps over the lazy dog.JPG")); printf("contains: %d\n", cstr_contains(ss, "umps ove")); diff --git a/examples/demos.c b/examples/demos.c index 1304cf85..99b9e570 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_first(&cs, "seven", "four"); + cstr_replace_first(&cs, 0, "seven", "four"); printf("%s.\n", cstr_str(&cs)); cstr_take(&cs, cstr_from_fmt("%s *** %s", cstr_str(&cs), cstr_str(&cs))); -- cgit v1.2.3