SD-Card read Textfile into String --> Then String Split

Hi,

i'm not new in programming (PHP is my best friend) but new in programming Arduino ;-(

The following function (reading out a textfile on a sd card) gives me the Output "Test#0/1#0/2#0/3#0/4"

String finalText="";
char filename[16] = {'\0'}; //16 characters in the filename (or however long you want to make it)
  myFile = SD.open("1.txt");
    while (myFile.available()) {
      finalText+=(char)myFile.read();
    }
  
  myFile.close();
  Serial.println(finalText);
}

But how can i get

Test
0/1
0/2
0/3
0/4

separated?

in PHP i would do

Test=explode("#", finalText);

This would return an array containing the values i need.

Please help ;-(

Best regards
Daniel

First, do not read into a String. Unless you know what you are doing, the use of Strings can cause memory corruprion bugs that can be hard to diagnose. Read into a null terminated character array and use strtok() to separate the data. Robin2's serial input basics tutorial shows how to do both.