FastTimeSpanParser

Ecng.Common

Provides high-performance parsing and formatting of TimeSpan values based on a specified template.

Конструкторы

FastTimeSpanParser
public FastTimeSpanParser(string template)
fastTimeSpanParser = FastTimeSpanParser(template)

Initializes a new instance of the FastTimeSpanParser class using the specified template.

template
A format template that defines how TimeSpan values are parsed and formatted. Must not be null or empty.

Свойства

Template
public string Template { get; }
value = fastTimeSpanParser.Template

Gets the template string used for parsing and formatting TimeSpan values.

Методы

Parse
public TimeSpan Parse(string input)
result = fastTimeSpanParser.Parse(input)

Parses the specified input string into a TimeSpan value based on the parser's template.

input
The string representation of a time span to parse.

Возвращает: A TimeSpan value that corresponds to the given input.

ToString
public string ToString(TimeSpan value)
result = fastTimeSpanParser.ToString(value)

Formats the specified TimeSpan value into a string using the parser's template.

value
The TimeSpan value to format.

Возвращает: A string representation of the TimeSpan value according to the template.

ToString
public override string ToString()
result = fastTimeSpanParser.ToString()

Returns a string representation of the tuple, with values separated by commas.

Возвращает: A string representing the tuple's values.