diff options
| author | Tyge Lovset <[email protected]> | 2022-12-20 23:31:51 +0100 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-12-20 23:31:51 +0100 |
| commit | 5f57d597cd27aef55adbcb3b452973b0c6e33667 (patch) | |
| tree | dfd59c2fd0e36a6ef37912a9d0cc5a65970f1524 /examples/utf8replace_c.c | |
| parent | 1763be8c8cbbc0896477fcf924edd4180d1345a9 (diff) | |
| download | STC-modified-5f57d597cd27aef55adbcb3b452973b0c6e33667.tar.gz STC-modified-5f57d597cd27aef55adbcb3b452973b0c6e33667.zip | |
Restructured folders: examples, benchmarks, tests into misc folder.
Diffstat (limited to 'examples/utf8replace_c.c')
| -rw-r--r-- | examples/utf8replace_c.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/examples/utf8replace_c.c b/examples/utf8replace_c.c deleted file mode 100644 index 22a5c990..00000000 --- a/examples/utf8replace_c.c +++ /dev/null @@ -1,23 +0,0 @@ -#define i_extern // add utf8 dependencies -#include <stc/cstr.h> -#include <stc/csview.h> - -int main() { - c_auto (cstr, hello, upper) { - hello = cstr_lit("hell😀 w😀rld"); - printf("%s\n", cstr_str(&hello)); - - /* replace second smiley at utf8 codepoint pos 7 */ - cstr_u8_replace(&hello, cstr_u8_to_pos(&hello, 7), 1, c_SV("🐨")); - printf("%s\n", cstr_str(&hello)); - - cstr_replace(&hello, "🐨", "ø", 1); - printf("%s\n", cstr_str(&hello)); - - upper = cstr_toupper_sv(cstr_sv(&hello)); - - c_foreach (c, cstr, hello) - printf("%.*s,", c_ARGSV(c.u8.chr)); - puts(""); - } -} |
