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 /docs/cstr_api.md | |
| 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 'docs/cstr_api.md')
| -rw-r--r-- | docs/cstr_api.md | 8 |
1 files changed, 4 insertions, 4 deletions
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: |
