Share via


IPNetwork.TryParse(ReadOnlySpan<Char>, IPNetwork) Method

Definition

Converts the specified ReadOnlySpan<T> of char representation of an IP address and a prefix length to its IPNetwork equivalent, and returns a value that indicates whether the conversion succeeded.

public static bool TryParse (ReadOnlySpan<char> networkSpan, out Microsoft.AspNetCore.HttpOverrides.IPNetwork? network);
static member TryParse : ReadOnlySpan<char> * IPNetwork -> bool
Public Shared Function TryParse (networkSpan As ReadOnlySpan(Of Char), ByRef network As IPNetwork) As Boolean

Parameters

networkSpan
ReadOnlySpan<Char>

The ReadOnlySpan<T> of char to validate.

network
IPNetwork

When this method returns, contains the IPNetwork equivalent to the IP Address and prefix length contained in networkSpan, if the conversion succeeded, or null if the conversion failed. This parameter is passed uninitialized.

Returns

true if the networkSpan parameter was converted successfully; otherwise false.

Applies to