Splitting serial string

Hi all,

can someone point me into the right direction regarding splitting a string that comes in through the serial port?

I want to send a string like "W,0,26" or "R,1" to the arduino, and depending on the string, take different actions.

Thanks in advance,

I've seen two things mentioned...

  1. scanf
    scanf site:arduino.cc - Google Search

  2. Hand-coded parsing...
    parse serial data site:arduino.cc - Google Search

You might want to research strtok(). It's available to Arduino sketches.