Can I do this also with "char" in stead of "string"?

I want to read the txt from the serial en split the data type "char" with charter space en print back to serial.

This code is working with string:

String getValue(String data, char separator, int index)
{
  int found = 0;
  int strIndex[] = {0, -1};
  int maxIndex = data.length()-1;

  for(int i=0; i<=maxIndex && found<=index; i++){
    if(data.charAt(i)==separator || i==maxIndex){
        found++;
        strIndex[0] = strIndex[1]+1;
        strIndex[1] = (i == maxIndex) ? i+1 : i;
        
    }
  }

  return found>index ? data.substring(strIndex[0], strIndex[1]) : "";
}

void setup() {
    Serial.begin(9600);

}

void loop() {

    String split = "Future time";
String word3 = getValue(split, ' ', 1);    // 0 is the index "Future" and 1 is the index "time"
Serial.println(word3);
delay(3000);
  
  
    }

Thanks in advance

Oke and how can I read from the serial to the char record?

Here the code:

#include <string.h>

char *record = "name:bob";
char *p;

void setup() {

  Serial.begin(9600);
  Serial.println("Starting..");
  
   //  First strtok iteration
   p = strtok(record,":");
   Serial.print(p);
   Serial.print(" = ");

   //  Second strtok iteration
   p = strtok(NULL,":");
   Serial.println(p);

}

void loop () {
}

The Thread serial input basics illustrates how to receive characters into a char array and includes a parse example.

...R

char messageFromPC[32] = {0};

The 32 is this the max char lengte?

There is not enough info on the website
http://arduino.cc/en/pmwiki.php?n=Reference/HomePage

I come from the Delphi language.

Thanks in advance