converting captured string to floats

I have an arduino device that captures incoming serial data from a sensor in the string that is made up of three numbers, separated by spaces, and ending with a letter, usually looks like this: -24 55.5 243t

I used to have an older sensor that outputted 3 integers, which was easy to parse using the following code. But now that the middle number is a float, my code breaks. I know that not many people recommend using the scanf() function anyway, and it appears it doesn't work for floats. I can't figure out how to use atof() on an array like this one. Is there a better option that I should try?

int x,z;
float y;
String testString = "-15 22.8 402t";

void setup()
{
  Serial.begin(9600);
}

void loop() {
  
  Serial.print("testString = ");
  Serial.println(testString);  //so you can see the captured string 
   char Carray[testString.length() + 1]; //determine size of the array
   testString.toCharArray(Carray, sizeof(Carray)); 
  Serial.print("Carray = ");
  Serial.println(Carray);
   sscanf (Carray, "%d %f %d", &x, &y, &z);
  Serial.println("THE DATA:");
  Serial.print("first= ");
  Serial.println(x);
  Serial.print("middle= ");
  Serial.println(y);
  Serial.print("last= ");
  Serial.println(z);
   
  delay(5000);   

  }

andywatson:
Is there a better option that I should try?

Don't capture the serial data using Strings.

Store the data in a string (null terminated char array) and use a combination of strtok(), atoi() and atof() to get the three numbers.

I thought there were going to be some new-fangled parsing functions included in the new Arduino 1.0 IDE, but I can't seem to find how they might be used in this case.

andywatson:
I thought there were going to be some new-fangled parsing functions included in the new Arduino 1.0 IDE, but I can't seem to find how they might be used in this case.

You have a string with various substrings deliminated by a space. strtok() allows you to iterate through those substrings.
You now have various substrings that contain numbers represented by ASCII. atoi() and atof() converts the strings into numbers.

I finally found a solution that is pretty simple and seems to be capturing the data correctly, using the parseInt() and parseFloat() functions.

   if (mySerial.available() > 0) {
    int x = mySerial.parseInt(); 
    float y = mySerial.parseFloat(); 
    int z = mySerial.parseInt();
    }