From 89424a2ff3a46dbd82a6954f97a25f973e981c98 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 1 Jun 2022 21:43:30 +0200 Subject: Renamed cstr_replace() => cstr_replace_at(), and cstr_replace_one() => cstr_replace(self, start, search, replace). --- docs/cstr_api.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 989f59df..ca6a7d3f 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -78,11 +78,11 @@ void cstr_insert(cstr* self, size_t pos, const char* ins); void cstr_insert_s(cstr* self, size_t pos, cstr ins); void cstr_insert_n(cstr* self, size_t pos, const char* ins, size_t n); -void cstr_replace(cstr* self, size_t pos, size_t len, const char* repl); +size_t cstr_replace(cstr* self, size_t start, const char* search, const char* repl); +void cstr_replace_all(cstr* self, const char* search, const char* repl); +void cstr_replace_at(cstr* self, size_t pos, size_t len, const char* repl); void cstr_replace_s(cstr* self, size_t pos, size_t len, cstr repl); void cstr_replace_n(cstr* self, size_t pos, size_t len, const char* repl, size_t n); -size_t cstr_replace_one(cstr* self, size_t startpos, const char* search, const char* repl); -void cstr_replace_all(cstr* self, const char* search, const char* repl); void cstr_erase(cstr* self, size_t pos); void cstr_erase_n(cstr* self, size_t pos, size_t n); @@ -149,7 +149,7 @@ int main() { cstr_erase_n(&s1, 7, 5); // -nine printf("%s\n", cstr_str(&s1)); - cstr_replace(&s1, cstr_find(s1, "seven"), 5, "four"); + cstr_replace_at(&s1, cstr_find(s1, "seven"), 5, "four"); printf("%s\n", cstr_str(&s1)); // reassign: -- cgit v1.2.3