Table of Contents

Method TryParse

Namespace
Ubiquity.NET.Versioning
Assembly
Ubiquity.NET.Versioning.dll

TryParse(string?, IFormatProvider?, out CSemVer)

Tries to parse a string into a value.

public static bool TryParse(string? s, IFormatProvider? provider, out CSemVer result)

Parameters

s string

The string to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

result CSemVer

When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Returns

bool

true if s was successfully parsed; otherwise, false.

Remarks

provider is ALWAYS ignored by this implementation. The format is defined by the spec and independent of culture.

TryParse(string?, out CSemVer, out Exception)

Applies try pattern to attempt parsing a CSemVer from a string

public static bool TryParse(string? s, out CSemVer result, out Exception reason)

Parameters

s string

Raw string to parse from

result CSemVer

Resulting version or default if parse is successful

reason Exception

Reason for failure to parse (as an Exception)

Returns

bool

true if parse is successful or false if not