summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/utf8replace_c.c
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-20 15:09:10 +0200
committertylov <[email protected]>2023-07-20 15:12:29 +0200
commit900295256d825fc323149cd223c49787f32a3696 (patch)
tree6c79cf4209e3975bb6865e2940b9cb56ea469c73 /misc/examples/utf8replace_c.c
parent224a04f7fa7549ed94d2a1415eb25829e39a7cca (diff)
downloadSTC-modified-900295256d825fc323149cd223c49787f32a3696.tar.gz
STC-modified-900295256d825fc323149cd223c49787f32a3696.zip
Moved examples to sub-directories. Added cotask1.c cotask2.c examples.
Diffstat (limited to 'misc/examples/utf8replace_c.c')
-rw-r--r--misc/examples/utf8replace_c.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/misc/examples/utf8replace_c.c b/misc/examples/utf8replace_c.c
deleted file mode 100644
index 1d54486f..00000000
--- a/misc/examples/utf8replace_c.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#define i_implement
-#include <stc/cstr.h>
-
-int main(void)
-{
- 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);
-}