YearMonthDuration.TryParse MethodYearMonthDuration.TryParse MethodYearMonthDuration::TryParse Method

Converts a lexical representation of an xs:yearMonthDuration to its YearMonthDurationYearMonthDurationYearMonthDuration equivalent. A return value indicates whether the conversion succeeded or failed.

Syntax

Public Shared Function TryParse( _
    value As String, _
    <Out>result As ByRef YearMonthDuration _
) As Boolean
public static bool TryParse(
    string value,
    out YearMonthDuration result
)
public:
static bool TryParse(
    String^ value, 
    [Out] YearMonthDuration% result
)
 

Parameters

value

Type: System.StringSystem.StringSystem::String^

The lexical representation of an xs:yearMonthDuration to convert.

result

Type: out XmlPrime.YearMonthDurationByRef XmlPrime.YearMonthDurationXmlPrime::YearMonthDuration%

When this method returns, contains the YearMonthDurationYearMonthDurationYearMonthDuration value equivalent to the xs:yearMonthDuration represented by value if the conversion succeeded, or zero (PT0S) if the conversion failed.

Return Value

Type: System.BooleanSystem.BooleanSystem::Boolean

trueTruetrue if the conversion succeeded; otherwise falseFalsefalse.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionvalue is null a null reference (Nothing in Visual Basic) nullptr.