Occurs2 Function | |
Return the number of times a substring occurs in a string.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION Occurs2(
cSearch AS STRING,
cTarget AS STRING
) AS DWORD
public static uint Occurs2(
string cSearch,
string cTarget
)
Request Example
View SourceParameters
- cSearch
- Type: String
The substring for which to search. - cTarget
- Type: String
The string in which to search. (To specify an offset, use Occurs3()).
Return Value
Type:
DWord
The number of times that
cSearch appears in
cTarget.
Remarks
Occurs2() is the same as Occurs().
Examples
This example shows typical use of Occurs():
1LOCAL cSearch AS STRING
2LOCAL cTarget AS STRING
3cSearch := "any"
4cTarget := "Anything goes anyway anytime."
5? Occurs2(cSearch, cTarget)
6? Occurs2("any","ANY any")
See Also