Implemented findFirstNonMatchingCharacter for fast string comparisons