summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-08-18 09:47:35 +0200
committerTyge Lovset <[email protected]>2022-08-18 09:47:35 +0200
commit9d20b5f012edd89fa48691ffb84fde71294f203c (patch)
tree5089e6f5550a6640341ecc06cf4df203cce4d428 /docs
parente774adc245c74341ec5c4318de0dfd24a42b21e5 (diff)
downloadSTC-modified-9d20b5f012edd89fa48691ffb84fde71294f203c.tar.gz
STC-modified-9d20b5f012edd89fa48691ffb84fde71294f203c.zip
Added cstr_u8_erase(). Renamed cstr_erase_n() => cstr_erase().
Diffstat (limited to 'docs')
-rw-r--r--docs/cstr_api.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index 8c28a601..273f4de4 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -63,8 +63,7 @@ void cstr_insert(cstr* self, size_t pos, const char* ins);
void cstr_insert_sv(cstr* self, size_t pos, csview ins);
void cstr_insert_s(cstr* self, size_t pos, cstr ins);
-void cstr_erase(cstr* self, size_t pos);
-void cstr_erase_n(cstr* self, size_t pos, size_t n); // erase n bytes from pos
+void cstr_erase(cstr* self, size_t pos, size_t len); // erase len bytes from pos
void cstr_replace(cstr* self, const char* search, const char* repl, unsigned count); // count==0: replace all.
cstr cstr_replace_sv(csview in, csview search, csview repl, unsigned count);
@@ -100,6 +99,7 @@ size_t cstr_u8_to_pos(const cstr* self, size_t u8idx); // byte po
const char* cstr_u8_at(const cstr* self, size_t u8idx); // char* position at utf8 codepoint index
csview cstr_u8_chr(const cstr* self, size_t u8idx); // get utf8 character as a csview
void cstr_u8_replace(cstr* self, size_t bytepos, size_t u8len, csview repl); // replace u8len utf8 chars
+void cstr_u8_erase(cstr* self, size_t bytepos, size_t u8len); // erase u8len codepoints from pos
// iterate utf8 codepoints
cstr_iter cstr_begin(const cstr* self);
@@ -165,7 +165,7 @@ int main() {
cstr_insert(&s1, 3, "-two");
printf("%s\n", cstr_str(&s1));
- cstr_erase_n(&s1, 7, 5); // -nine
+ cstr_erase(&s1, 7, 5); // -nine
printf("%s\n", cstr_str(&s1));
cstr_replace(&s1, "seven", "four", 1);