Rune.GetRuneAt(String, Int32) 方法

定义

获取在字符串中指定位置开始的 RuneGets the Rune that begins at a specified position in a string.

public:
 static System::Text::Rune GetRuneAt(System::String ^ input, int index);
public static System.Text.Rune GetRuneAt (string input, int index);
static member GetRuneAt : string * int -> System.Text.Rune
Public Shared Function GetRuneAt (input As String, index As Integer) As Rune

参数

input
String

从中创建 rune 的字符串。The string from which to create the rune.

index
Int32

input 中创建 rune 的起始位置。The starting position in input at which to create the rune.

返回

Rune

input 中的指定 index 处获取的 rune。The rune obtained from input at the specified index.

例外

inputnullinput is null.

index 不引用 input 中有效标量值的开头。index does not reference the start of a valid scalar value in input.

index 超出了 input 的范围。index is outside the range of input.

注解

如果 inputnullindex 超出范围或 index 未引用中有效标量值的开头,则会引发异常 inputThrows an exception if input is null, index is out of range, or index does not reference the start of a valid scalar value within input.

适用于