Go Down

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


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.

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