DotNetWikiBot Framework Documentation
Assembly: DotNetWikiBot (in DotNetWikiBot.dll) Version: 0.0.0.0
Returns the number of found occurrences.
This auxiliary function counts the occurrences of specified string
in specified text. This count is often required, but strangely there is no
such function in .NET Framework's String class.
Namespace: DotNetWikiBotAssembly: DotNetWikiBot (in DotNetWikiBot.dll) Version: 0.0.0.0
Syntax
C# |
---|
public static int CountMatches( string text, string str, bool ignoreCase ) |
Parameters
- text
- Type: System..::..String
String to look in.
- str
- Type: System..::..String
String to look for.
- ignoreCase
- Type: System..::..Boolean
Pass "true" if you require case-insensitive search. Case-sensitive search is faster.
Return Value
Type: Int32Returns the number of found occurrences.
Examples
Copy | |
---|---|
int m = Bot.CountMatches("Bot Bot bot", "Bot", false); // m=2 |