StringUtilsSubstringCount Method |
Counts the number of matching substrings in the given string.
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static int SubstringCount(
string s,
string sub,
StringComparison cmp
)
Public Shared Function SubstringCount (
s As String,
sub As String,
cmp As StringComparison
) As Integer
Parameters
- s
- Type: SystemString
The string in which to search. - sub
- Type: SystemString
The substring for which to search. - cmp
- Type: SystemStringComparison
The type of comparison to use.
Return Value
Type:
Int32The number of instances of the substring in the string, zero if either string is null or empty.
See Also