Common Logging 2.0 API Reference

ArgUtils.TryParse(T) Method

Tries parsing stringValue into the specified return type.

[Visual Basic]
Public Shared Sub TryParse(Of T)( _
   ByVal defaultValue As T, _
   ByVal stringValue As String _
)
[C#]
public static T TryParse<T>(
   T defaultValue,
   string stringValue
);

Parameters

defaultValue
the default value to return if parsing fails
stringValue
the string value to parse

Return Value

the successfully parsed value, defaultValue otherwise.

See Also

ArgUtils Class | Common.Logging.Configuration Namespace