Forum inglese qui ... C'è una sezione italiana se non si legge / scrive inglese
english forum here... There is an Italian section if you don't read/write english
I would suggest you study Serial Input Basics and stop using the String class in favor of functions from the standard libraires (such as stdlib.h or string.h)
for example parsing a c-string like this
"[color=blue]123-45-218-644-228-32-1-666[/color]"
can be achieved with the strtok() function and calling this repetitively
here is some code
char cstringToParse[100];
void setup() {
Serial.begin(115200);
strcpy(cstringToParse, "123-45-218-644-228-32-1-666"); // to simulate receiving from wherever
char * item = strtok(cstringToParse, "-");
while (item != NULL) {
Serial.println(item);
item = strtok(NULL, "-");
}
}
void loop() {}
that will print in the console
[sub][color=blue]123
45
218
644
228
32
1
666
[/color][/sub]
and this would look like this
