copying from array

Hi everyone.
I have received an array from WiFi in my ESP8266. The array contains this information:

0123-45-67890

This information is saved in an char array named buffer1! and they are ascii codes.

How can I use numbers between any "-"?

This is my code if it helps:

void callback(char* topic, byte* payload, unsigned int length)
{
  char buffer1[30];
  memcpy(buffer1, payload, length);  //copy the payload to the buffer
  buffer1[length] = '\0';  //terminate the string (NOT a String !
  char * outTopic = "ESP8266Client";
  client.publish(outTopic , buffer1);
}

Check out strtok function.

wow! That was a quick response, thank you very much. That worked perfect