diff options
| author | Tyge Løvset <[email protected]> | 2022-09-06 18:20:23 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-06 18:20:23 +0200 |
| commit | 90311ff7eb34e5fc4fc1c2c38b8d0433642e9659 (patch) | |
| tree | 11352fe3b7530ed1c6b49fa1914ccef7142c92b4 /examples/utf8replace_c.c | |
| parent | 2857a84df612d2e1ae4389e3a747a39d933c0400 (diff) | |
| download | STC-modified-90311ff7eb34e5fc4fc1c2c38b8d0433642e9659.tar.gz STC-modified-90311ff7eb34e5fc4fc1c2c38b8d0433642e9659.zip | |
- Added c_foreach_token(it, ...) macro in csview.h.
- Changed c_foreach_match(it, ...): to access matches, use it.match[j]
- splitstr.c now shows usages of both the above.
Diffstat (limited to 'examples/utf8replace_c.c')
| -rw-r--r-- | examples/utf8replace_c.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/utf8replace_c.c b/examples/utf8replace_c.c index e7659cfd..b43aab6f 100644 --- a/examples/utf8replace_c.c +++ b/examples/utf8replace_c.c @@ -8,8 +8,7 @@ int main() { printf("%s\n", cstr_str(&hello)); /* replace second smiley at utf8 codepoint pos 7 */ - cstr_u8_replace(&hello, cstr_find(&hello, "😀rld"), 1, c_sv("🐨")); - + cstr_u8_replace(&hello, cstr_u8_to_pos(&hello, 7), 1, c_sv("🐨")); printf("%s\n", cstr_str(&hello)); cstr_replace(&hello, "🐨", "ø", 1); |
