Need help splitting string into array

Hello there, I'm trying to split a string that my arduino receives : 1000;1000;1000;1000;1000;1000 into sections of 1000 into an array so basically I need my result to be:

arrayx[1] = 1000
arrayx[2] = 1000
arrayx[3] = 1000
arrayx[4] = 1000
arrayx[5] = 1000
arrayx[6] = 1000

void setup() {
  Serial.begin(9600);
  delay(1000);
}

void loop() {
 String SerialInput;
  if (Serial.available()){
    delay(30); //wait for full input
    SerialInput.concat(char(Serial.read()));
	while (Serial.available() > 0){
	  SerialInput.concat(char(Serial.read())); //Here I got my full string received from serial
	}

    //How can I split my string into 6 seperate array entries here?
    
    
    Serial.print(SerialInput);
    Serial.println();
  }
}

I've tried many stuff like

char *p = SerialInput;
var i=0;
char *str;
while ((str = strtok_r(p, ";", &p)) != NULL) {
array = str;
i++;
}[/quote]
But I always end up having string conversinon errors, I cannot seem to understand how stings function in C languages, I'm decently skilled with Visual Basic and advanced with PHP
Can anyone point me in the right way? Regards

1000;1000;1000;1000;1000;1000 is 6 groups of 4 characters plus 5 separators, for a total of 29 characters.

  if (Serial.available()){
    delay(30); //wait for full input

At 9600 baud, that will require more than 30 milliseconds to arrive. Delaying, in the hope that all the data magically shows up while you are twiddling your thumbs, is not a good idea. Sending an end-of-packet marker, and reading and storing serial data until that end of packet marker arrives is a much better idea.

SerialInput.concat(char(Serial.read())); //Here I got my full string received from serial

Wrong. Here you get one byte at a time, until all the data that has arrived SO FAR has been read.

//How can I split my string into 6 seperate array entries here?

Using the strtok function.

I've tried many stuff like

Who ever suggested that you use the strtok_r function was sadly misinformed. The _r version is the thread-safe, re-entrant version of strtok. Since the Arduino is not a multi-threaded platform, there is no reason to drag in all the overhead of thread safe code.

Still, the strtok function usage requires two steps. The first call to strtok defines the char array to process, not the String object, along with the delimiter(s) to use. The output is a pointer to the first token, which is a null-terminated array of characters. Whether that is appropriate to store in the array, or not, is unknown, because we don't know what type arrayx is. If it is of type pointer to char, then the pointer returned by strtok can be stored there. If arrayx is of type int, then the pointer to char that strtok returns can not. You'd need to pass the pointer to atoi(), and store atoi()'s output in the array.

Subsequent calls to strtok are made in a while loop, typically, with NULL as the first argument, to tell strtok to get the next token from the same string, rather than the first token from a new string.

So, you need to fix how you send data, and how you receive it.
Then, you need to extract the character array from the String object (toCharArray() will be useful). Or, even better, dispense with the String object, and simply store the incoming character data in a char array.
Finally, you need to call the correct function (strtok) with the correct input (the char array or NULL, depending on which token you want), and process the output correctly.

Thank you, You've helped me making the serial get data method failsafe, Now the real part comes in:

I have a STRING containing '1000;1000;1000;1000;1000;1000;'

To use strtok I need a char* container,

How can I convert my string into a char*?

(By the way, would you mind explaining what the difference is between a string and a char, char and a char*?)

Regards

In Arduino, "string" is char*.

String is an object that is backed with a char*.

char is an 8-bit datatype.

char* is a pointer to a character. In C/C++, we usually use char* to represent a string, as pointers can be indexed like arrays:

//allocate 8 bytes of memory starting at my_str (my_str[0]).
char* my_str = (char*) malloc(8 * sizeof(char));

char[0] = 'h';
char[1] = 'i';
char[2] = '\0';

Note that for all the string helper functions like strcmp and strtok to work, the string (char*) must end with the null byte, '\0'.

If you want to stay somewhat simple with strings, the below code might be of use. The first code captures strings that are seperated with a ";" and prints them to the serial monitor. The second code has a method in it of converting a string into an array, and then into an intger for use with servo control.

//zoomkat 9-9-10 simple delimited ';' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
// CR/LF could also be a delimiter

String readString;

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

void loop() {

        //expect a string like wer;qwe rty;123 456;hyre kjhg;
        //or like hello world;who are you?;bye!;
        while (Serial.available()) {
        delay(1);  //small delay to allow input buffer to fill
    	if (Serial.available() >0) {
        char c = Serial.read();  //gets one byte from serial buffer
        if (c == ';') {break;}  //breaks out of capture loop to print readstring
        readString += c; } //makes the string readString
        }
      
      if (readString.length() >0) {
      Serial.println(readString); //prints string to serial port out
      
      readString=""; //clears variable for new input
      }
   }
  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string 
    int n;
    char carray[6]; //converting string to number
    readString.toCharArray(carray, sizeof(carray));
    n = atoi(carray); 
    myservo.writeMicroseconds(n); // for microseconds
    //myservo.write(n); //for degees 0-180
    readString="";
  }

In Arduino, "string" is char*.

In C a "string" is a name. not a type. It refers to a NULL terminated array of characters (char {}). One can create a pointer to point to (the first position of) that array (char *).