Go Down

Topic: serial communication problem (Read 1 time) previous topic - next topic


Why the ">=0"?

Because indexOf() returns the offset from the beginning of the String to the searched for string. The searched for string could be at the start of the searched String, so offset would be 0. It could be somewhere else, so offset would be > 0. It could not exist, so offset would be -1.
The art of getting good answers lies in asking good questions.


Why the ">=0"?

In this case it is copy/paste carryover from serial code that does not use a delimiter. You should be able to remove it if desired.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


thank you for the help and info

Go Up