How to slice/split a string by delimiter

Getting back to the OP's issue, the attached is a String handler that I used some time ago for parsing CSV GPS data. You could tweak it to deal with other separators.

It presumes,

byte commaCount;
String msgField[25]; -> large enough to handle the guessed at number of fields in a full message
String fullMsg = "";

and that whatever you wish to parse is in fullMsg.

//===============================================
void getCSVfields()
{
    byte sentencePos =0;
    commaCount=0;
    msgField[commaCount]="";
    while (sentencePos < fullMsg.length())
    {
        if(fullMsg.charAt(sentencePos) == ',')
        {
            commaCount++;
            msgField[commaCount]="";
            sentencePos++;
        }
        else
        {
            msgField[commaCount] += fullMsg.charAt(sentencePos);
            sentencePos++;
        }
    }
}
//===============================================