User Tools

Site Tools


syntax:functions:find

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:find [2015/04/03 11:16] elenapsyntax:functions:find [2021/08/02 00:13] craigt
Line 1: Line 1:
-===== Find(text, string) =====+====== Find(text, look_for) =====
 +Category:  Text function
  
-A search function that finds the exact position of specific text string in a field or in text. First character has index 1.+\\  
 +=====Description===== 
 +This function finds the exact position of //look_for// within //text// and returns the position of the first character.  If //look_for// is not found within //text// then it returns 0.
  
-The search returns 1 (or other number depending on the position of //string// in //text//) in each line the //string// is found in. If //string// is not found, the search returns 0.+The first character in //text// has an index of 1.
  
-Both arguments are implicitly converted into text values, if required.+\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|text|Text|The text value to search within for the //look_for// string.| 
 +|look_for|Text|The text string to search for within //text//.|
  
-^  Example  ^  Result +**Return value type:** Number
-| find('Los Angeles', 'Los')|  1  |+
  
-Examples using a field name:+\\  
 +=====Remarks===== 
 +This function is case sensitive.
  
-^  Example  ^  City  ^  Result  ^   +Both arguments are implicitly converted to text values if required.
-| find([Сity],'York' |  New York  |  5  |  +
-| find([Сity],'York' |  Dallas  |  0  |  +
-| find([Сity],'York' |  York  |  1  |+
  
 +\\ 
 +=====Examples=====
 +
 +  find('New York', 'York') = 5
 +  find('New York', 'New') = 1
 +  find('New York', 'Dallas') = 0
 +  find('New York New York', 'York') = 5  //Returns the position of the first instance only
 +  find('New York', 'new') = 0  //Unmatched due to case
 +  find([City], 'Ant') = 5  //Using a field name; [City] = 'San Antonio'
 +  find(1200, 2) = 2  //Numeric values are converted to text implicitly
 +
 +\\ 
 +===== See also =====
 +  * [[syntax:functions:contains]|Contains(text, look_for)]]
 +  * [[syntax:functions:endswith]|EndsWith(text1, look_for)]]
 +  * [[syntax:functions:startswith]|StartsWith(text1, look_for)]]
  
-=== See also === 
-  * [[syntax:functions:contains|contains]] 
-  * [[syntax:functions:endswith]] 
-  * [[syntax:functions:startswith]] 
syntax/functions/find.txt · Last modified: 2021/08/14 22:04 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki