I think this is a bug in String::indexOfAnyOf:
while (*t != 0)
if (CharacterFunctions::indexOfChar (charactersToLookFor, *t++, ignoreCase) >= 0)
return (int) (t - text->text);
When one of the charactersToLookFor is found, t is incremented before returning the result. The function thus returns the character index + 1.
The simple fix:
while (*t != 0)
{
if (CharacterFunctions::indexOfChar (charactersToLookFor, *t, ignoreCase) >= 0)
return (int) (t - text->text);
++t;
}
regards,
Francis.