System::TimeSpan::TryParse method

TimeSpan::TryParse(const String&, TimeSpan&) method

Converts string to equivalent TimeSpan object and returns result of conversion.

static bool System::TimeSpan::TryParse(const String &input, TimeSpan &result)
ParameterTypeDescription
inputconst String&Input string.
resultTimeSpan&Time interval that corresponds to string.

ReturnValue

True if string was converted successfully; otherwise, false.

See Also

TimeSpan::TryParse(const String&, const SharedPtr<IFormatProvider>&, TimeSpan&) method

Converts string to equivalent TimeSpan object using the specified format provider and returns result of conversion.

static bool System::TimeSpan::TryParse(const String &input, const SharedPtr<IFormatProvider> &provider, TimeSpan &result)
ParameterTypeDescription
inputconst String&Input string.
providerconst SharedPtr<IFormatProvider>&Format provider that supplies culture-specific formatting information.
resultTimeSpan&Time interval that corresponds to string.

ReturnValue

True if string was converted successfully; otherwise, false.

See Also

TimeSpan::TryParse(const String&, const SharedPtr<Globalization::CultureInfo>&, TimeSpan&) method

static bool System::TimeSpan::TryParse(const String &input, const SharedPtr<Globalization::CultureInfo> &culture, TimeSpan &result)

See Also

TimeSpan::TryParse(const String&, const SharedPtr<Globalization::DateTimeFormatInfo>&, TimeSpan&) method

static bool System::TimeSpan::TryParse(const String &input, const SharedPtr<Globalization::DateTimeFormatInfo> &dtfi, TimeSpan &result)

See Also

TimeSpan::TryParse(const String&, std::nullptr_t, TimeSpan&) method

static bool System::TimeSpan::TryParse(const String &input, std::nullptr_t, TimeSpan &result)

See Also