Method IndexOfOccurence
IndexOfOccurence(string, char, int, int)
Reports the zero-based index of the occurenceCount
occurrence of the specified character in this instance. The search starts at a specified character position.
public static int IndexOfOccurence(this string s, char toLookFor, int startIndex, int occurenceCount)
Parameters
s
stringSource string to process.
toLookFor
charA Unicode character to seek.
startIndex
intThe search starting position.
occurenceCount
intThe number of occurence to examine.
Returns
- int
The zero-based index position of
toLookFor
from thestartIndex
of the source string if that string is found, or -1 if it is not.