Uri.TryEscapeDataString 方法

定义

尝试将范围转换为其转义表示形式。

public:
 static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public static bool TryEscapeDataString (ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten);
static member TryEscapeDataString : ReadOnlySpan<char> * Span<char> * int -> bool
Public Shared Function TryEscapeDataString (charsToEscape As ReadOnlySpan(Of Char), destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

参数

charsToEscape
ReadOnlySpan<Char>

要转义的跨度。

destination
Span<Char>

包含操作转义结果的输出范围。

charsWritten
Int32

此方法返回时,包含写入 destination的字符数。

返回

如果 destination 足够大来容纳整个结果,则 true;否则,false

适用于