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
stringThe string to parse.
provider
IFormatProviderAn object that provides culture-specific formatting information about
s
.result
CSemVerWhen this method returns, contains the result of successfully parsing
s
or an undefined value on failure.
Returns
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
stringRaw string to parse from
result
CSemVerResulting version or default if parse is successful
reason
ExceptionReason for failure to parse (as an Exception)