When it comes to parsing the data from the serial port, you receive one byte at a time, which falls into one of 4 catagories: start, string, delimiter and stop. Assuming your strings do not ever contain the same characters for the start, delimiter and stop, then you can make simple arguments to determine when you store the received byte in the array and when you insert a null.