Class TimeSpanParser
Represents a class which contains a
Inheritance
Namespace: X10D.Time
Assembly: X10D.dll
Syntax
public static class TimeSpanParser : object
Methods
| Improve this Doc View SourceTryParse(ReadOnlySpan<Char>, out TimeSpan)
Attempts to parses a shorthand time span (e.g. 3w 2d 1h) as a span of characters, converting it to an instance of
Declaration
public static bool TryParse(ReadOnlySpan<char> value, out TimeSpan result)
Parameters
Type | Name | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ReadOnlySpan<System.Char> | value | The input span of characters. Floating point is not supported, but range the following units are supported:
|
||||||||||||||||||
TimeSpan | result | When this method returns, contains the parsed result. |
Returns
Type | Description |
---|---|
System.Boolean | true if the parse was successful, false otherwise. |
TryParse(Nullable<String>, out TimeSpan)
Attempts to parses a shorthand time span string (e.g. 3w 2d 1h), converting it to an instance of
Declaration
public static bool TryParse(string? value, out TimeSpan result)
Parameters
Type | Name | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
System.Nullable<System.String> | value | The input string. Floating point is not supported, but range the following units are supported:
|
||||||||||||||||||
TimeSpan | result | When this method returns, contains the parsed result. |
Returns
Type | Description |
---|---|
System.Boolean | true if the parse was successful, false otherwise. |