diff options
| author | tylov <[email protected]> | 2023-08-13 23:15:45 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-08-13 23:15:45 +0200 |
| commit | 25dc58db206714dc02c1ae0548f6ba7dd3519d29 (patch) | |
| tree | dcf65b08300d82c4d6752284d5c0a5a00507f07f /misc/examples/strings/splitstr.c | |
| parent | 8bb2f5618e4cefe668a663936354cf53191f2129 (diff) | |
| download | STC-modified-25dc58db206714dc02c1ae0548f6ba7dd3519d29.tar.gz STC-modified-25dc58db206714dc02c1ae0548f6ba7dd3519d29.zip | |
API CHANGES:
Changed csview: becomes a null-terminated string view.
Added csubview: a null-terminated string view/span, like previous csview.
Note that csview works like a csubview, so not much compability issues should arise.
However, some functions have changed from _sv suffix to _ss.
Diffstat (limited to 'misc/examples/strings/splitstr.c')
| -rw-r--r-- | misc/examples/strings/splitstr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/strings/splitstr.c b/misc/examples/strings/splitstr.c index ef7ed174..6fa76d34 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/csview.h> +#include <stc/csubstr.h> int main(void) { - puts("Split with c_fortoken (csview):"); + puts("Split with c_fortoken (csubstr):"); c_fortoken (i, "Hello World C99!", " ") - printf("'%.*s'\n", c_SV(i.token)); + printf("'%.*s'\n", c_SS(i.token)); puts("\nSplit with c_formatch (regex):"); cregex re = cregex_from("[^ ]+"); c_formatch (i, &re, " Hello World C99! ") - printf("'%.*s'\n", c_SV(i.match[0])); + printf("'%.*s'\n", c_SS(i.match[0])); cregex_drop(&re); } |
