If the data "123456789" is a String object as defined here: http://arduino.cc/en/Reference/StringObject
then you can use any of the String object functions to parse the object.
CAVEAT: please read this first: http://forum.arduino.cc/index.php/topic,124367.0.html
The String Object is not a highly recommended approach. That being said, if will work.
IF the data "123456789" is coming in over a port (say, serial port) then you must aggregate individual character digits (bytes) until you have all 9 digits in one string object. IF you have control over the incoming data string format, you can take a different approach by using delimiters, that is: "123 " "456 " "789 " or "123,456,489" or a variety of similar approaches. See my calculator code for how I parse commands and numerics: http://forum.arduino.cc/index.php?topic=172406.msg1280843#msg1280843