I have a string of text that I'm trying to locate the periods, so I do string.indexOf("."); to get the index value. It returns to correct position when the text looks like this:
The cat is here.
but the index is off by one when the text looks like this:
The cat is here
.
Every time when I space it down the index returned is thrown off, what should I do?