-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
39 lines (29 loc) · 1.12 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include "c_string.h"
int main(void) {
c_string* s = malloc(sizeof(c_string));
//create_string(s, "---&ABC---League-Hello");
// char* string = "---&ABC-----0321849325---a-a-a-a-x--";
char* string = "ABB--CAW";
size_t length = strlen(string);
s->string = calloc(length, sizeof(char));
create_string(s, length, string);
//create_string(s, "ABB--CAW");
c_string** result = string_delim(s, "--");
print_delim_strings(result);
//pretty_print(result);
//printf("%.*s\n", result[0]->length, result[0]->string);
//printf("%.*s\n", result[1]->length, result[1]->string);
//printf("%.*s\n", result[2]->length, result[2]->string);
//printf("%.*s\n", result[3]->length, result[3]->string);
//printf("%.*s\n", result[4]->length, result[4]->string);
//printf("%.*s\n", result[5]->length, result[5]->string);
//printf("%.*s\n", result[6]->length, result[6]->string);
//printf("%.*s\n", result[7]->length, result[7]->string);
destroy_delim_string(result);
//c_string* stripped = trim_char(s, '-');
//destroy_string(stripped);
//destroy_string(data);
destroy_string(s);
return 0;
}