28 lines
715 B
C
28 lines
715 B
C
#include <fx/core/stringstream.h>
|
|
#include <fx/ds/string.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void)
|
|
{
|
|
printf("здравс\u26A0твуите\n");
|
|
fx_string *str = fx_string_create_from_cstr("здравствуите");
|
|
const char *s = fx_string_ptr(str);
|
|
printf("%s\n", s);
|
|
printf("len: %zu\n", fx_string_get_size(str, FX_STRLEN_NORMAL));
|
|
printf("codepoints: %zu\n", fx_string_get_size(str, FX_STRLEN_CODEPOINTS));
|
|
|
|
const char *delims[] = {"в"};
|
|
size_t nr_delims = sizeof delims / sizeof delims[0];
|
|
|
|
fx_iterator *it = fx_string_tokenise(str, delims, nr_delims, 0);
|
|
fx_foreach(const char *, tok, it)
|
|
{
|
|
printf("%s\n", tok);
|
|
}
|
|
fx_iterator_unref(it);
|
|
fx_string_unref(str);
|
|
|
|
return 0;
|
|
}
|