Table of Contents

Method TryParse

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

TryParse(string?, IFormatProvider?, out CSemVerCI)

Tries to parse a string into a value.

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

Parameters

s string

The string to parse.

provider IFormatProvider

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

result CSemVerCI

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.

TryParse(string?, out CSemVerCI, out Exception)

Applies try pattern to attempt parsing a CSemVerCI from a string

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

Parameters

s string

Raw string to parse from

result CSemVerCI

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