I need the function to return the character position at which there was a difference.
StringCompare2 ( "string1", "string2)
Returns 7
StringCompare2 ( "letter", "string2)
Returns 1
StringCompare2 ( "str", "string2)
Returns 4
StringCompare2 ( "str1", "string2)
Returns 4
StringCompare2 ( "str1", "str1)
Returns 0 (full coincidence)
If I search in a sorted array, the index of coincidence will increase, then decrease. When reduced, there is no reason to check further.