public static bool TryConvert<TTarget>( this Object? obj, out TTarget value )
<ExtensionAttribute> Public Shared Function TryConvert(Of TTarget) ( obj As Object, <OutAttribute> ByRef value As TTarget ) As Boolean
public: [ExtensionAttribute] generic<typename TTarget> static bool TryConvert( Object^ obj, [OutAttribute] TTarget% value )
[<ExtensionAttribute>] static member TryConvert : obj : Object * value : 'TTarget byref -> bool
The method firstly tries to use registered direct conversions between source and target types, then attempts to perform the conversion via IConvertible types and registered TypeConverters. If these attempts fail, then the registered conversions tried to be used for intermediate steps, if possible. As an ultimate fallback, the String type is attempted to be used as intermediate conversion.
New conversions can be registered by the RegisterConversion extension methods.