Many ways to do this. You could use strchr() to find the opening bracket ('[') and then search for the commas and break up the string. Or you could use strtok(). The first thing I would do is get rid of the String class variable msg and make is a char msg[] array. Once you've done that, study what you find here