[This is preliminary documentation and is subject to change.]
Returns a string value converted to desired type with optional default and format
Namespace: NFX.EnvironmentAssembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
public static string GetValueAs(
string value,
string type,
string dflt = null,
string fmt = null
)
public static string GetValueAs(
string value,
string type,
string dflt = null,
string fmt = null
)
Public Shared Function GetValueAs (
value As String,
type As String,
Optional dflt As String = Nothing,
Optional fmt As String = Nothing
) As String
Public Shared Function GetValueAs (
value As String,
type As String,
Optional dflt As String = Nothing,
Optional fmt As String = Nothing
) As String
public:
static String^ GetValueAs(
String^ value,
String^ type,
String^ dflt = nullptr,
String^ fmt = nullptr
)
public:
static String^ GetValueAs(
String^ value,
String^ type,
String^ dflt = nullptr,
String^ fmt = nullptr
)
static member GetValueAs :
value : string *
type : string *
?dflt : string *
?fmt : string
(* Defaults:
let _dflt = defaultArg dflt null
let _fmt = defaultArg fmt null
*)
-> string
static member GetValueAs :
value : string *
type : string *
?dflt : string *
?fmt : string
(* Defaults:
let _dflt = defaultArg dflt null
let _fmt = defaultArg fmt null
*)
-> string
Parameters
- value
- Type:
System String
String value to convert
- type
- Type:
System String
A type to convert string value into i.e. "decimal"
- dflt (Optional)
- Type:
System String
Default value which is used when conversion of original value can not be made
- fmt (Optional)
- Type:
System String
Format string that formats the converted value. Example: 'Goods: {0}'. The '0' index is the value
Return Value
Type:
StringConverted value to desired type then back to string, using optional formatting and default if conversion did not succeed