User Tools

Site Tools


syntax:functions:match

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
syntax:functions:match [2016/06/20 11:23] dmitrysyntax:functions:match [2021/09/13 22:44] craigt
Line 1: Line 1:
-===== Match(value, valuesseparator) =====+====== Match(value, text_listdelimiter) =====
 +Category:  Special function
  
-Returns position of value in a list of values which is a text stringdelimited by separator. Values in the delimited string are always considered text, even if they look like a number. First argument is implicitly converted to text. Separator value may contain more than 1 character.+\\  
 +=====Description===== 
 +This function returns the position index of //value// in a list of values (//text_list//)separated by //delimiter//
  
-^  Example  ^  Result  ^ +\\  
-| match(5, '5;55;555', ';' |  1| +=====Use cases===== 
-| match('55', '555;55;5', ';' |  2|+This function makes it possible to define EasyMorph expressions externally using parameters.
  
-=== See also ===+\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|value|Any|The value to search for within //text_list// This argument is implicitly converted to text.| 
 +|text_list|Text|A text-based delimited list of values to search for //value//.| 
 +|delimiter|Text|The 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:in|In(text, look_in, delimiter)]] 
 +  * [[syntax:functions:pick|Pick(index, text_list, delimiter)]] 
 +  * [[transformations:group|Group (action)]]
  
-  * [[syntax:functions:in]] 
-  * [[syntax:functions:pick]] 
-  * [[transformations:group|Group]] 
syntax/functions/match.txt · Last modified: 2021/09/13 22:46 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki