Click or drag to resize

StringParserIndexOfPreviousToken(String, Char, Int32, Int32, Boolean) Method

Processing from RIGHT to LEFT, finds the index of the "n" occurrence of a character (a token) within a string

Namespace: GSF.Parsing
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public static int IndexOfPreviousToken(
	string inString,
	char token,
	int startIndex = 0,
	int occurrenceCount = 1,
	bool matchCase = true
)
View Source

Parameters

inString  String
The string to process.
token  Char
The token character sought
startIndex  Int32  (Optional)
Default of zero (0) begins testing end of inString, otherwise The index from with to begin processing inString from RIGHT to LEFT
occurrenceCount  Int32  (Optional)
The occurrence sought
matchCase  Boolean  (Optional)
Set to FALSE for case insensitive search

Return Value

Int32
Returns the starting index of the nth occurrence of a character. Returns -1 if nth occurrence does not exist.
See Also