Table of Contents

SubstringCount(text, look_for)

Category: Text function


Description

This function returns the number of instances of look_for found within text.


Arguments

ArgumentTypeDescription
textTextThe text value to search within for the look_for string.
look_forTextThe 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 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)