Refactor string

This commit is contained in:
2022-08-22 12:13:20 +03:00
parent 205c8337c2
commit ca8251973e
19 changed files with 627 additions and 1111 deletions
+5 -5
View File
@@ -2,8 +2,8 @@
/* Copyright © 2022 Gregory Lirent */
#include <stdio.h>
#include "../include/extra/string.h"
#include "../include/extra/array.h"
#include "../include/array.h"
#include "../include/string.h"
typedef vtype_string str_t;
typedef vtype_array arr_t;
@@ -25,14 +25,14 @@ int main(int argc, char** argv) {
printf("%s\n", str.buffer);
arr_t parts = string_split(&str, ',', -1);
arr_t parts = string_split(&str, ',');
printf("%lu\n", array_size(&parts));
for (size_t i = 0; i < array_size(&parts); ++i) {
str_t* value = array_at(&parts, i);
str_t* value = at_array(&parts, i);
string_trim_spaces(value);
string_trim(value, 0);
printf("%s (%lu)\n", value->buffer, string_nmemb(value));
}