diff options
| author | _Tradam <[email protected]> | 2023-09-08 01:29:47 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-08 01:29:47 +0000 |
| commit | 3c76c7f3d5db3f9586a90d03f8fbb02d79de9acd (patch) | |
| tree | afbe4b540967223911f7c5de36559b82154f02f3 /misc/examples/utf8replace_c.c | |
| parent | 0841165881871ee01b782129be681209aeed2423 (diff) | |
| parent | 1a72205fe05c2375cfd380dd8381a8460d9ed8d1 (diff) | |
| download | STC-modified-modified.tar.gz STC-modified-modified.zip | |
Diffstat (limited to 'misc/examples/utf8replace_c.c')
| -rw-r--r-- | misc/examples/utf8replace_c.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/misc/examples/utf8replace_c.c b/misc/examples/utf8replace_c.c deleted file mode 100644 index 3cde8701..00000000 --- a/misc/examples/utf8replace_c.c +++ /dev/null @@ -1,24 +0,0 @@ -#include <stc/cstr.h> - -int main() -{ - cstr hello = cstr_lit("hell😀 w😀rld"); - printf("%s\n", cstr_str(&hello)); - - /* replace second smiley at utf8 codepoint pos 7 */ - cstr_u8_replace_at(&hello, - cstr_u8_to_pos(&hello, 7), - 1, - c_sv("🐨") - ); - printf("%s\n", cstr_str(&hello)); - - c_foreach (c, cstr, hello) - printf("%.*s,", c_SV(c.u8.chr)); - - cstr str = cstr_lit("scooby, dooby doo"); - cstr_replace(&str, "oo", "00"); - printf("\n%s\n", cstr_str(&str)); - - c_drop(cstr, &hello, &str); -} |
