Skip to content

M_Cyjb_StringView_LastIndexOf_2

CYJB edited this page Mar 20, 2024 · 2 revisions

StringView.LastIndexOf 方法 (Char, Int32, Int32)

返回当前字符串视图中指定字符最后一次出现的索引。

Namespace: Cyjb
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public int LastIndexOf(
	char value,
	int startIndex,
	int count
)

参数

 

value
Type: System.Char
要检查的字符。
startIndex
Type: System.Int32
搜索起始位置。
count
Type: System.Int32
要搜索的字符个数。

返回值

Type: Int32
value 最后一次出现的索引,如果不存在则返回 -1

Exceptions

 

异常 条件
ArgumentOutOfRangeException startIndexcount 小于零。
ArgumentOutOfRangeException startIndex + count 表示的位置不在当前字符串视图内。

Remarks

查找时使用区分大小写和不区分区域性的序列比较。

参见

Reference

StringView 结构
LastIndexOf 重载
Cyjb 命名空间

Clone this wiki locally