StringSegment.IndexOf 方法

定义

重载

IndexOf(Char, Int32, Int32)

获取 c 字符在此 StringSegment 中的第一个匹配项从零开始的索引。 搜索从 start 开始,并检查指定数量的 count 字符位置。

IndexOf(Char)

获取 c 字符在此 StringSegment 中的第一个匹配项从零开始的索引。

IndexOf(Char, Int32)

获取 c 字符在此 StringSegment 中的第一个匹配项从零开始的索引。 搜索的起始位置为 start

IndexOf(Char, Int32, Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

获取 c 字符在此 StringSegment 中的第一个匹配项从零开始的索引。 搜索从 start 开始,并检查指定数量的 count 字符位置。

public:
 int IndexOf(char c, int start, int count);
public int IndexOf (char c, int start, int count);
member this.IndexOf : char * int * int -> int
Public Function IndexOf (c As Char, start As Integer, count As Integer) As Integer

参数

c
Char

要查找的 Unicode 字符。

start
Int32

搜索起始位置的从零开始的索引位置。

count
Int32

要检查的字符数。

返回

如果找到该字符,则为从 StringSegment 的起始位置起 c 从零开始的索引位置;如果未找到,则为 -1。

例外

startcount 小于零,或 start + count 大于 Length

适用于

IndexOf(Char)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

获取 c 字符在此 StringSegment 中的第一个匹配项从零开始的索引。

public:
 int IndexOf(char c);
public int IndexOf (char c);
member this.IndexOf : char -> int
Public Function IndexOf (c As Char) As Integer

参数

c
Char

要查找的 Unicode 字符。

返回

如果找到该字符,则为从 StringSegment 的起始位置起 c 从零开始的索引位置;如果未找到,则为 -1。

适用于

IndexOf(Char, Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

获取 c 字符在此 StringSegment 中的第一个匹配项从零开始的索引。 搜索的起始位置为 start

public:
 int IndexOf(char c, int start);
public int IndexOf (char c, int start);
member this.IndexOf : char * int -> int
Public Function IndexOf (c As Char, start As Integer) As Integer

参数

c
Char

要查找的 Unicode 字符。

start
Int32

搜索起始位置的从零开始的索引位置。

返回

如果找到该字符,则为从 StringSegment 的起始位置起 c 从零开始的索引位置;如果未找到,则为 -1。

例外

start 大于或等于 Length,或小于零。

适用于