How to split a webhook response

Hi, in my project I have a webhook that request 3 data (out of a bunch) and this works perfect. In fact I have set in my webhook response a webhook template with those 3 lines:
{{ lausanne.elev1}}
{{lausanne.elev2}}
{{lausanne.elev3}}

In my code, I use the :

_> Particle.subscribe(“hook-response/elevations”, Lausanne MY_DEVICES);

I created the Lausanne function :

_> void Lausanne(const char *event, const char *data) {
__> _
_> // Particle.publish(“elevations”, data);
_> // delay(6000);
_> }

I get the 3 expected values separated by a white space ( 8.54 7.43 22.4).

Is there a simple way to split that String into 3 float variables ?

Many thanks

I’d do it with a combination of strtok() and atof()

or sscanf()…

sscanf(my_c_String, "%f %f %f", &value1, &value2, &value3);

This would be my prefered way too, but I’m not convinced this works with floats on Particle devices - at least it didn’t use to work that way.

you are probably right! cursed C