string view ahora soporta caracteres anchos y chop by type con una funcion por parametro
This commit is contained in:
+3
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user