Go Down

Topic: Reference documentation error - substring (Read 213 times) previous topic - next topic

Leonas

Just spent 30 minutes trying to find out why my program was not working. In the end it was an error in the reference that misled me.
https://www.arduino.cc/en/Tutorial/StringSubstring

Quote
This looks for the word text from positions 14 through 18 of the String.
That should not be through but to. The 18th position is not included. I should have counted the positions of 'text' in the bigger string earlier... :(

IMO, it would be more logical if the 'text' would be found with "if (stringOne.substring(14,17) == "text") " and then 'through' would have been correct.

Go Up