summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/strings/splitstr.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-08-14 16:46:24 +0200
committerTyge Løvset <[email protected]>2023-08-14 16:46:24 +0200
commit78d8668e6d527070568a405408ed906e51055bf4 (patch)
tree60f963a36826acce264c7ecd0af3eb80502a4335 /misc/examples/strings/splitstr.c
parent2b6b4785c5c26bc47d800c1a7c7a48784df2d57b (diff)
downloadSTC-modified-78d8668e6d527070568a405408ed906e51055bf4.tar.gz
STC-modified-78d8668e6d527070568a405408ed906e51055bf4.zip
Reverted csubstr => csview. Sorry about that!
Added crawstr to become the null-terminated string view.
Diffstat (limited to 'misc/examples/strings/splitstr.c')
-rw-r--r--misc/examples/strings/splitstr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/strings/splitstr.c b/misc/examples/strings/splitstr.c
index 6fa76d34..ef7ed174 100644
--- a/misc/examples/strings/splitstr.c
+++ b/misc/examples/strings/splitstr.c
@@ -2,20 +2,20 @@
#define i_import // cstr + utf8 functions
#include <stc/cregex.h>
#define i_implement
-#include <stc/csubstr.h>
+#include <stc/csview.h>
int main(void)
{
- puts("Split with c_fortoken (csubstr):");
+ puts("Split with c_fortoken (csview):");
c_fortoken (i, "Hello World C99!", " ")
- printf("'%.*s'\n", c_SS(i.token));
+ printf("'%.*s'\n", c_SV(i.token));
puts("\nSplit with c_formatch (regex):");
cregex re = cregex_from("[^ ]+");
c_formatch (i, &re, " Hello World C99! ")
- printf("'%.*s'\n", c_SS(i.match[0]));
+ printf("'%.*s'\n", c_SV(i.match[0]));
cregex_drop(&re);
}