#include #include int main() { char *s = "DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique"; if (s) { char *c = strchr(s, ':'); if (c) { char *p = strchr(c+1 , ','); if (p) *p = 0; } char *p = strchr(s, ','); if (p) { if (c) memmove(p, c, strlen(c) + 1); else *p = 0; } printf("%s\n", s); } }