Rune.TryGetRuneAt(String, Int32, Rune) Method

Definition

尝试获取在字符串的指定位置处开始的 Rune,并返回指示操作是否成功的值。Attempts to get the Rune that begins at a specified position in a string, and return a value that indicates whether the operation succeeded.

public:
 static bool TryGetRuneAt(System::String ^ input, int index, [Runtime::InteropServices::Out] System::Text::Rune % value);
public static bool TryGetRuneAt (string input, int index, out System.Text.Rune value);
static member TryGetRuneAt : string * int * Rune -> bool
Public Shared Function TryGetRuneAt (input As String, index As Integer, ByRef value As Rune) As Boolean

Parameters

input
String

从中提取 rune 的字符串。The string from which to extract the rune.

index
Int32

从中提取 rune 的从零开始的索引。The zero-based index from which to extract the rune.

value
Rune

此方法返回时,已解码的 rune。When this method returns, the decoded rune.

Returns

Boolean

如果成功从指定索引中提取标量值,则为 true;如果某值由于无效数据而无法进行提取,则为 falsetrue if a scalar value was successfully extracted from the specified index; false if a value could not be extracted because of invalid data.

Exceptions

inputnullinput is null.

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

Applies to