[This is preliminary documentation and is subject to change.]
Tries to get a string value as specified type.
When 'strict=false', tries to do some inference like return "true" for numbers that dont equal to zero etc.
When 'strict=true' throws an exception if deterministic conversion is not possible
Namespace: NFXAssembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
public static Object AsType(
this string val,
Type tp,
bool strict = true
)
public static Object AsType(
this string val,
Type tp,
bool strict = true
)
<ExtensionAttribute>
Public Shared Function AsType (
val As String,
tp As Type,
Optional strict As Boolean = true
) As Object
<ExtensionAttribute>
Public Shared Function AsType (
val As String,
tp As Type,
Optional strict As Boolean = true
) As Object
public:
[ExtensionAttribute]
static Object^ AsType(
String^ val,
Type^ tp,
bool strict = true
)
public:
[ExtensionAttribute]
static Object^ AsType(
String^ val,
Type^ tp,
bool strict = true
)
static member AsType :
val : string *
tp : Type *
?strict : bool
(* Defaults:
let _strict = defaultArg strict true
*)
-> Object
static member AsType :
val : string *
tp : Type *
?strict : bool
(* Defaults:
let _strict = defaultArg strict true
*)
-> Object
Return Value
Type:
ObjectUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).