System::String::LastIndexOf 方法

String::LastIndexOf(char_t) const method

字符向后查找。

int System::String::LastIndexOf(char_t value) const
参数类型描述
char_t要查找的字符。

ReturnValue

最后一个字符位置的索引,如果未找到则为 -1。

另见

String::LastIndexOf(char_t, int32_t) const method

字符向后查找。

int System::String::LastIndexOf(char_t value, int32_t startIndex) const
参数类型描述
char_t要查找的字符。
startIndexint32_t开始查找的索引。

ReturnValue

从 startIndex 开始的最后一个字符位置的索引,如果未找到则为 -1。

另见

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

字符向后查找。

int System::String::LastIndexOf(char_t value, int32_t startIndex, int32_t count) const
参数类型描述
char_t要查找的字符。
startIndexint32_t开始查找的索引。
countint32_t要遍历的字符数

ReturnValue

从 startIndex 开始的最后一个字符位置的索引,如果未找到则为 -1。

另见

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

子串向后查找。

int System::String::LastIndexOf(const String &str, int startIndex, System::StringComparison comparison_type) const
参数类型描述
strconst String&要查找的子字符串。
startIndexint在源字符串中开始查找的位置。
comparison_typeSystem::StringComparisonComparison 模式。

ReturnValue

最后找到的子字符串的索引,如果未找到则为 -1。对于空的查找字符串,总是返回字符串长度。

另见

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

子串向后查找。

int System::String::LastIndexOf(const String &str, int startIndex=INT32_MAX) const
参数类型描述
strconst String&要查找的子字符串。
startIndexint在源字符串中开始查找的位置。

ReturnValue

最后找到的子字符串的索引,如果未找到则为 -1。对于空的查找字符串,总是返回字符串长度。

另见

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

子串向后查找。

int System::String::LastIndexOf(const String &str, System::StringComparison comparison_type) const
参数类型描述
strconst String&要查找的子字符串。
comparison_typeSystem::StringComparisonComparison 模式。

ReturnValue

最后找到的子字符串的索引,如果未找到则为 -1。对于空的查找字符串,总是返回字符串长度。

另见

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

子串向后查找。

int System::String::LastIndexOf(const String &value, int startIndex, int count, StringComparison comparisonType) const
参数类型描述
const String&要查找的子字符串。
startIndexint在源字符串中开始查找的位置。
countint要遍历的字符数。
comparisonTypeStringComparisonComparison 模式。

ReturnValue

最后找到的子字符串的索引,如果未找到则为 -1。对于空的查找字符串,总是返回 startIndex+count。

另见