Please check milkstrings.
Sample code :
int main(int argc, char * argv[]) {
tXt s = "123,456,789" ;
s = txtReplace(s,"123","321") ; // replace 123 by 321
int num = atoi(txtEat(&s,',')) ; // pick the first number
printf("num = %d s = %s \n",num,s) ;
s = txtPrintf("%s,%d",s,num) ; // printf in new string
printf("num = %d s = %s \n",num,s) ;
s = txtConcat(s,"<-->",txtFlip(s),NULL) ; // concatenate some strings
num = txtPos(s,"987") ; // find position of substring
printf("num = %d s = %s \n",num,s) ;
if (txtAnyError()) { //check for errors
printf("%s\n",txtLastError()) ;
return 1 ; }
return 0 ;
}