I have a String e.g. “95651” which is got the double quotes in it.
Getting rid of the quotes is easy enough using
String mySmallerString = myString.substring(1, myString.length()-1);
But I need to get the string into an Integer with the value of 95651. How do I do that?
I tried this
char * params = new char[mySmallerString.length() + 1]; strcpy(params, mySmallerString.c_str()); myInt = atoi(params);
But myInt now contains 163 instead of 95651.
Is there a way I can first test of the String has Double quotes in it, remove them and the move the value into an Integer variable?