I seem to get errors a lot because strlen just gives the length but positions with a string are different because the first char is position zero.
When determining whether a given position within a string is out of range (passed the the end of string) sometimes I use '>=' other times I compare the position with ($strLen - 1). Is there a good way to consistently deal with this?
When determining whether a given position within a string is out of range (passed the the end of string) sometimes I use '>=' other times I compare the position with ($strLen - 1). Is there a good way to consistently deal with this?