if you have char * , you can think of it as an array or as a string, since the memory layout is the same ...
char * input = "(8,7,1,0,0,0,b,b,b,b,b,b,b,b,b,b,b,b,s,s,r,r,g,b,r,g,r,r,r,r,b,r,r,s,b,b,b,b,r,s,s,r,b,b,r,s,s,s,r,b,g,b,r,r,r,r,r,r,r,r,r,s) 0"; size_t len = strlen(input); int currentIndex = 0; char * output = calloc(1,len); for (int i = 0 ; i<len ; i++) { if (input[i] == '(' || input[i] == ')' || input[i] == ','|| input[i] == ' ') { continue; } output[currentIndex++] = input[i]; } assert(strlen(output) == 63);
the main thing that I would add if you want to use it more as a string, then you need to make array 1 bigger and set board[60] = \0;