string view ahora soporta caracteres anchos y chop by type con una funcion por parametro

This commit is contained in:
2026-11-15 18:45:26 -03:00
parent d8903b05de
commit fb4017ecb1
4 changed files with 239 additions and 16 deletions
+3 -2
View File
@@ -2,7 +2,7 @@
#include <stdio.h>
int main(void) {
const char *data = " xHola mundo con string view- ";
StringView s2 = sv_from_cstr("😊");
StringView s2 = sv_from_cstr("😊 hdr 😊");
StringView hola = sv_from_cstr(data);
sv_ltrim(&hola);
@@ -16,7 +16,8 @@ int main(void) {
sv_trim(&trim);
printf("El string view contiene: %s\n", s2.text);
printf("El length es: %zu\n", s2.length);
printf("El length es: %zu y la cantidad de caracteres es: %zu\n", s2.length,
sv_chars_count(&s2));
printf("hola tiene:%.*s\n", (int)hola.length, hola.text);
printf("view tiene:%.*s\n", (int)view.length, view.text);