For example, the string is: namespace:name
but I want to get only namespace, how can I do that?
I tried this but I don't know how to output only the namespace
char id[] = "namespace:name";
char* token = strtok(id, ":");
while (token != NULL)
{
printf("%s\n", token);
token = strtok(NULL, ":");
}