StringExtensions.As StringExtensions.As StringExtensions.As Method

Definition

Overloads

As<TValue>(String) As<TValue>(String) As<TValue>(String)

Converts a string to a strongly typed value of the specified data type.

As<TValue>(String, TValue) As<TValue>(String, TValue) As<TValue>(String, TValue)

Converts a string to the specified data type and specifies a default value.

As<TValue>(String) As<TValue>(String) As<TValue>(String)

Converts a string to a strongly typed value of the specified data type.

public static TValue As<TValue> (this string value);
static member As : string -> 'Value
<Extension()>
Public Function As(Of TValue) (value As String) As TValue
Type Parameters
TValue

The data type to convert to.

Parameters
value
String String String

The value to convert.

Returns

The converted value.

As<TValue>(String, TValue) As<TValue>(String, TValue) As<TValue>(String, TValue)

Converts a string to the specified data type and specifies a default value.

public static TValue As<TValue> (this string value, TValue defaultValue);
static member As : string * 'Value -> 'Value
<Extension()>
Public Function As(Of TValue) (value As String, defaultValue As TValue) As TValue
Type Parameters
TValue

The data type to convert to.

Parameters
value
String String String

The value to convert.

defaultValue

The value to return if value is null.

Returns

The converted value.

Applies to