count-substring
Returns an integer value expressing the number of times that substr occurs in string.

Languages
Built-in, C++, C#, Java.
Parameters
Name  | Type  | Description  | 
|---|---|---|
string  | xs:string  | The input string.  | 
substr  | xs:string  | The sub-string to test for.  | 
Example
The following mapping returns 2. This is the number of times that the pipe separator occurs within the input string id|name|email.
