Rune.TryGetRuneAt(String, Int32, Rune) 方法

定義

嘗試從字串中指定位置的開頭取得 Rune 並傳回值,指出作業是否成功。

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

參數

input
String

要從中擷取 rune 的字串。

index
Int32

要從中擷取 rune 的以零起始索引。

value
Rune

當此方法傳回時,會是已解碼的 rune。

傳回

Boolean

如果已成功從指定的索引擷取純量值,則為 false;如果因為資料無效而無法擷取值,則為 true

例外狀況

inputnull

index 超出 input 的範圍。

備註

如果 inputnullindex 超出範圍,則會擲回例外狀況。

適用於