So I have a String str = "116,3" and I am trying to get the two numbers into two other different strings:
String foo = str.substring(0, str.indexOf(','));
Serial.println("First substring: " + foo);
String foo2 = str.substring((str.indexOf(',') + 1));
Serial.println("Second substring: " + foo2);
And the only thing I get on output is Second substring: 3.
Why isn't the first one working ?
Thank you.