I have the following string:
String msg = "t22h58m798s2";
Than I created some variables:
int temperature;
int humidity;
int moisture;
int state;
I need to set value of temperature to two numbers after t character in msg. The same for other variables. Finally temperature should be 22, humidity - 58, moisture - 798 and state - 2. I receive msg from other Arduino's sensor values. I think I should do it using indexOf and charAt method, but I'm not sure how. Please hep me.