Match First String Function

Owning Palette: Additional String VIs and Functions

Requires: Base Development System

Compares each prefix string in string array to the beginning of string until it encounters a match. This function returns the original input string with the matching prefix string removed.

Details  

 Add to the block diagram  Find on the palette
string specifies the string to match to the prefixes in string array. The default is an empty string.
string array specifies the array of strings that you want to match with string. If the function encounters an empty string in string array, the function considers that string a match.
output string returns the original string with the matching prefix removed. If the beginning of string does not match any string in string array, output string returns the original string.
index returns the numeric index of the matching prefix in string array. If the beginning of string does not match any string in string array, index is –1.

Match First String Details

This function compares each string in string array to string in the order in which the elements are indexed. This function always searches from the beginning of string and matches the first string prefix that appears at the beginning of string. For example, this function matches Error 1 in the string Error 16: error occurred if Error 1 comes before Error 16 in string array. However, the function matches Error 16 if Error 16 comes before Error 1 in string array.