Share via


HeaderUtilities.TryParseNonNegativeInt64(StringSegment, Int64) Method

Definition

Try to convert a StringSegment representation of a positive number to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.

public:
 static bool TryParseNonNegativeInt64(Microsoft::Extensions::Primitives::StringSegment value, [Runtime::InteropServices::Out] long % result);
public static bool TryParseNonNegativeInt64 (Microsoft.Extensions.Primitives.StringSegment value, out long result);
static member TryParseNonNegativeInt64 : Microsoft.Extensions.Primitives.StringSegment * int64 -> bool
Public Shared Function TryParseNonNegativeInt64 (value As StringSegment, ByRef result As Long) As Boolean

Parameters

value
StringSegment

A StringSegment containing a number to convert.

result
Int64

When this method returns, contains the 64-bit signed integer value equivalent of the number contained in the string, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the StringSegment is null or String.Empty, is not of the correct format, is negative, or represents a number greater than Int64.MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Returns

true if parsing succeeded; otherwise, false.

Applies to