<-- Previous || Up || Next -->

First Non Matching Position Function
String Searches Class

Public Function FirstNonMatchingPosition( _
      ByVal vOne As Variant _
    , ByVal vTwo As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Returns the position of the first non-matching characters in corresponding positions of the two strings.

Examples:
    FirstNonMatchingPosition("AAABBBCCC", "AAACCCDDD") = 4
    FirstNonMatchingPosition("AAABBBCCC", "AAABBBCCC") = 0
    FirstNonMatchingPosition("AAABBBCCC", "AAABBB") = 7
See also:
    FirstMatchingPosition Function
    DifferenceString Function
    ContrastStrings Function
vOne: One of the two strings from which characters in corresponding positions will be compared for a match. Function returns Null if vOne is Null or cannot be fixed up to a String.

vTwo: One of the two strings from which characters in corresponding positions will be compared for a match. Function returns Null if vTwo is Null or cannot be fixed up to a String.

vCompare: Specifies the type of comparison used to determine if corresponding characters match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

Function returns 0 (zero) if all corresponding characters match and the strings have the same length.

Function returns the length of the shorter string plus one if all corresponding characters match but the strings have different lengths.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.