mirror of
https://github.com/tezc/sc.git
synced 2025-01-28 07:03:06 +08:00
26 lines
463 B
C
26 lines
463 B
C
#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--");
|
|
printf("%s \n", s1); // prints **hello** world--
|
|
|
|
sc_str_trim(&s1, "*-");
|
|
printf("%s \n", s1); // prints hello** world
|
|
|
|
sc_str_substring(&s1, 8, 13);
|
|
printf("%s \n", s1); // world
|
|
|
|
sc_str_destroy(s1);
|
|
|
|
return 0;
|
|
}
|