IndexOf()

String::IndexOf(const String&, System::StringComparison) const method

Substring forward lookup.

int System::String::IndexOf(const String &str, System::StringComparison comparison_type) const

Arguments

ParameterTypeDescription
strconst String&Substring to look for.
comparison_typeSystem::StringComparisonComparison mode.

Return Value

Index of first found substring or -1 if not found. For empty lookup string, always returns 0.

String::IndexOf(char_t, int) const method

Character forward lookup.

int System::String::IndexOf(char_t c, int startIndex=0) const

Arguments

ParameterTypeDescription
cchar_tCharacter to look for.
startIndexintIndex to start lookup at.

Return Value

Index of first character position since startIndex or -1 if not found.

String::IndexOf(char_t, int, int) const method

Character forward lookup in substring.

int System::String::IndexOf(char_t c, int startIndex, int count) const

Arguments

ParameterTypeDescription
cchar_tCharacter to look for.
startIndexintIndex to start lookup at.
countintNumber of characters to look through.

Return Value

Index of first character position since startIndex or -1 if not found.

String::IndexOf(const String&, int) const method

Substring forward lookup.

int System::String::IndexOf(const String &str, int startIndex=0) const

Arguments

ParameterTypeDescription
strconst String&Substring to look for.
startIndexintPosition in source string to start lookup through.

Return Value

Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

String::IndexOf(const String&, int, System::StringComparison) const method

Substring forward lookup.

int System::String::IndexOf(const String &str, int startIndex, System::StringComparison comparison_type) const

Arguments

ParameterTypeDescription
strconst String&Substring to look for.
startIndexintPosition in source string to start lookup through.
comparison_typeSystem::StringComparisonComparison mode.

Return Value

Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

String::IndexOf(const String&, int, int, System::StringComparison) const method

Substring forward lookup.

int System::String::IndexOf(const String &value, int startIndex, int count, System::StringComparison comparisonType) const

Arguments

ParameterTypeDescription
valueconst String&Substring to look for.
startIndexintPosition in source string to start lookup through.
countintnumber of characters to look through.
comparisonTypeSystem::StringComparisonComparison mode.

Return Value

Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

String::IndexOf(const String&, int, int) const method

Substring forward lookup.

int System::String::IndexOf(const String &str, int startIndex, int count) const

Arguments

ParameterTypeDescription
strconst String&Substring to look for.
startIndexintPosition in source string to start lookup through.
countintnumber of characters to look through.

Return Value

Index of first found substring or -1 if not found. For empty lookup string, always returns startIndex.

See Also