MemoryMarshal.TryGetString Metodo

Definizione

Prova a ottenere la stringa sottostante da un System.ReadOnlyMemory<Char>.

public:
 static bool TryGetString(ReadOnlyMemory<char> memory, [Runtime::InteropServices::Out] System::String ^ % text, [Runtime::InteropServices::Out] int % start, [Runtime::InteropServices::Out] int % length);
public static bool TryGetString (ReadOnlyMemory<char> memory, out string? text, out int start, out int length);
public static bool TryGetString (ReadOnlyMemory<char> memory, out string text, out int start, out int length);
static member TryGetString : ReadOnlyMemory<char> * string * int * int -> bool
Public Shared Function TryGetString (memory As ReadOnlyMemory(Of Char), ByRef text As String, ByRef start As Integer, ByRef length As Integer) As Boolean

Parametri

memory
ReadOnlyMemory<Char>

Memoria di sola lettura che contiene un blocco di caratteri.

text
String

Quando il metodo termina, stringa contenuta nel buffer di memoria.

start
Int32

Posizione iniziale in text.

length
Int32

Numero di caratteri in text.

Restituisce

true se il metodo recupera correttamente la stringa sottostante; in caso contrario, false.

Si applica a