2020-11-11 01:19:49 +03:00
|
|
|
#include "sc_str.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
char* s1;
|
|
|
|
|
|
|
|
s1 = sc_str_create("**hello**");
|
|
|
|
printf("%s \n", s1); // prints **hello**
|
|
|
|
|
|
|
|
sc_str_append_fmt(&s1, " %s", "world--");
|
2020-12-28 06:18:18 +03:00
|
|
|
printf("%s \n", s1); // prints **hello** world--
|
2020-11-11 01:19:49 +03:00
|
|
|
|
|
|
|
sc_str_trim(&s1, "*-");
|
2020-12-28 06:18:18 +03:00
|
|
|
printf("%s \n", s1); // prints hello** world
|
2020-11-11 01:19:49 +03:00
|
|
|
|
2020-12-28 06:18:18 +03:00
|
|
|
sc_str_substring(&s1, 8, 13);
|
2020-11-11 01:19:49 +03:00
|
|
|
printf("%s \n", s1); // world
|
|
|
|
|
|
|
|
sc_str_destroy(s1);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|