FirstMatchIndex ( values ; string )
Returns the index of the first value that contains the search string.
Average rating: 4.0 (25 votes) Log in to vote
Richard Dyce - Show more from this author
Dyce & Sons Ltd.
FirstMatchIndex ( "abc¶023¶abc¶def¶123¶def"; "XYZ")
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
A quick function to return the index of the first value in 'values' that contains the search 'string'. If the string isn't found returns 0.
Feb 26, 2016
|FirstMatchIndex ( "Alfred¶Betty¶Fred¶George" ; "Fred" ) returns 1 instead of the expected 3. This is because you're not testing for the position of the string *as a value*.
ValueCount ( Left ( values ; Position ( ¶ & values & ¶ ; ¶ & string & ¶ ; 1 ; 1 ) ) )
|Richard Dyce, Dyce & Sons Ltd.
Mar 25, 2020
|Err, no. If that's what you want, try https://www.briandunning.com/cf/2342 or https://www.briandunning.com/cf/2342 ; This function specifically is looking for a partial match. Returning 1 is precisely what "first value in 'values' that contains the search 'string'" is meant to mean - hence the 'contains'. ;-)|
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.