Let's Make Robots!

"explode" array in arduino!?

// My array look like this in string
var str 'one|two|three|four';

// is there a function like EXPLODE in Arduino?
Serial.println(explode('|'str, -1));

If not, any method to do something similar? Thanks in advance if anyone has any clue :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Please take into account that the strtok() modifies the original string (it puts the pointer at the start of the word and replaces the tokens with \0 NULL characters to terminate it).

Keep that in mind if you wonder why the contents of your "one|two|three|four" string changed :)

you could use something like this? http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1226107230/3#3

Basile