User Tools

Site Tools


syntax:functions:substringcount

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
syntax:functions:substringcount [2016/06/20 11:43] dmitrysyntax:functions:substringcount [2021/08/14 22:25] (current) – [Examples] craigt
Line 1: Line 1:
-===== Substringcount(text, string) =====+====== SubstringCount(text, look_for) =====
 +Category:  Text function
  
-Counts number of entries of //string// in //text//.+\\  
 +=====Description===== 
 +This function returns the number of instances of //look_for// found within //text//.
  
- Example   Result  +\\  
-substringcount( 'one-two-three', '-' )   |+=====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//.|
  
 +**Return value type:** Number
 +
 +\\ 
 +=====Remarks=====
 +This function is case sensitive.  To perform a case insensitive search, convert //text// to uppercase first using [[syntax:functions:upper|Upper(text)]].
 +
 +Both arguments are implicitly converted to text values if required.
 +
 +\\ 
 +=====Examples=====
 +
 +  substringcount('one-two-three', '-') //Returns 2
 +
 +  substringcount('192.168.110.1', '1') //Returns 5
 +
 +  substringcount('Mississippi', 'S') //Returns 0  (Case-sensitive, no capital "s")
 +
 +  substringcount(upper('Mississippi'), 'S') //Returns 4  (Convert to uppercase first)
 +
 +  substringcount(1000,0) //Returns 3  (Numbers implicitly converted to text)
  
syntax/functions/substringcount.1466437388.txt.gz · Last modified: 2016/06/20 11:43 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki