work whit string

hello all
I have an string that include Several Numbers like{22,33,11}
and I want to separate this numbers and save to Variables
like a=22; b=33; c=11;
what i can to do?

Hello,

You can use sscanf or strtok

sscanf example:

char str[] = "{22,33,11}";
 
uint8_t a, b, c;

if ( sscanf( str, "{%hhu,%hhu,%hhu}", &a, &b, &c ) == 3 )
{
  Serial.println( a );
  Serial.println( b );
  Serial.println( c );
}

The parse example in serial input basics illustrates how to split that sort of data

...R

That string looks like JSON - can you use someone else's JSON parser?

p990:
hello all
I have an string that include Several Numbers like{22,33,11}
and I want to separate this numbers and save to Variables
like a=22; b=33; c=11;
what i can to do?

Is there an end of string/packet marker to indicate that the three values have arriived? If so, then the capture and parsing is fairly simple.