Function String Searches Class

MaxCorrespondingCharacters

" Maximum Corresponding Characters" Return a string where each character represents the maximum ASCII value of the characters in the corresponding position within all of the string arguments. Will return the character from the first string with the maximum value if many characters tie for the maximum.

Signature (Visual Basic / VBA)

Public Function MaxCorrespondingCharacters( _
      ByVal vCompare As Variant _
    , ParamArray vStrings() As Variant _
    ) As Variant

Code Example

    MaxCorrespondingCharacters(vbTextCompare, "12345ABCDE", "ABCDE67890") = "ABCDEABCDE"
    MaxCorrespondingCharacters(vbTextCompare, "abcDEF", "ABCdef") = "abcDEF"
    MaxCorrespondingCharacters(vbTextCompare, "123456", "789") = "789"

Parameters

Parameter Description
vCompare Specifies the type of comparison used to determine if characters in corresponding positions match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.
vStrings One or more string whose corresponding character positions are to be examined. Function returns Null if any argument is Null or cannot be fixed up to a String. Function only compares corresponding characters up to the length of the shortest string--any characters in positions beyond the length of the shortest string are ignored.