User Tools

Site Tools


syntax:functions:match

Match(value, text_list, delimiter)

Category: Special function


Description

This function returns the position index of value in a list of values (text_list), separated by delimiter.


Use cases

This function makes it possible to define EasyMorph expressions externally using parameters.


Arguments

ArgumentTypeDescription
valueAnyThe value to search for within text_list. This argument is implicitly converted to text.
text_listTextA text-based delimited list of values to search for value.
delimiterTextThe character(s) used to separate the individual values in text_list. This can be more than one character.

Return value type: Number


Remarks

This function returns 0 if value is not found within text_list.

The values in the delimited string (text_list) are always considered text, even if they look like a number. The first argument (value) is implicitly converted to text.

Delimiter may contain more than one character.


Examples

match(5, '5;55;555', ';')  //Returns 1
match('55', '555;55;5', ';')  //Returns 2
match('11', '4;8;12;16;20', ";")  //Returns 0  ('11' is not present in the list.)


See also

syntax/functions/match.txt · Last modified: 2021/09/13 22:46 by craigt