C-DEngine 5.105

TheCommonUtils..::..CStringPosInStringList Method

Search for a token in a compound string,

Namespace:  nsCDEngine.BaseClasses
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static int CStringPosInStringList(
	string strIn,
	string pSearchStr,
	char sep
)
Public Shared Function CStringPosInStringList ( _
	strIn As String, _
	pSearchStr As String, _
	sep As Char _
) As Integer
public:
static int^ CStringPosInStringList(
	String^ strIn, 
	String^ pSearchStr, 
	wchar_t^ sep
)

Parameters

strIn
Type: String
A compound string made up of multiple tokens.
pSearchStr
Type: String
The token to search for.
sep
Type: Char
The delimiter character in the compound string.

Return Value

A zero-based index for the string when found. Returns -1 means token not found.

Remarks


A compound string is a string made up of multiple tokens, with a delimiter character separating tokens from one another. The return value is not the character position, but instead is the count of delimiter characters from the start of the string to the search string. For example, in the following call CStringPosInStringList("first;second;third", "second", ';') the function returns 1.