LastIndexOf()

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

Substring backward lookup.

int System::String::LastIndexOf(const String &str, int startIndex=INT32_MAX) const

Arguments

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

Return Value

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

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

Substring backward lookup.

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

Arguments

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

Return Value

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

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

Substring backward lookup.

int System::String::LastIndexOf(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 last found substring or -1 if not found. For empty lookup string, always returns string length.

String::LastIndexOf(const String&, int, int, StringComparison) const method

Substring backward lookup.

int System::String::LastIndexOf(const String &value, int startIndex, int count, 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.
comparisonTypeStringComparisonComparison mode.

Return Value

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

String::LastIndexOf(char_t) const method

Character backward lookup.

int System::String::LastIndexOf(char_t value) const

Arguments

ParameterTypeDescription
valuechar_tCharacter to look for.

Return Value

Index of last character position or -1 if not found.

String::LastIndexOf(char_t, int32_t) const method

Character backward lookup.

int System::String::LastIndexOf(char_t value, int32_t startIndex) const

Arguments

ParameterTypeDescription
valuechar_tCharacter to look for.
startIndexint32_tIndex to start lookup at.

Return Value

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

String::LastIndexOf(char_t, int32_t, int32_t) const method

Character backward lookup.

int System::String::LastIndexOf(char_t value, int32_t startIndex, int32_t count) const

Arguments

ParameterTypeDescription
valuechar_tCharacter to look for.
startIndexint32_tIndex to start lookup at.
countint32_tNumber of characters to look through

Return Value

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

See Also