indexOfDiff()

Determine where 2 strings begin to differ from each other.

This function is valid in v2.3.0 to v2.14.0. This function has been downloaded 44 times.

Parameters

{string} str1
A string to be compared to another string.
{string} str2
A string to be compared to str1.

Returns

{number}
If str1 matches str2, -1 will be returned. In all other cases, the first index at which the corresponding character in str1 is not the same as that found in str2 will be returned.