NullableTypes Class Library

NullConvert.From Method (NullableInt32, String, String)

Converts the specified NullableInt32 value to an equivalent String value using a conventional String value to represent the Null value.

[Visual Basic]
Overloads Public Shared Function From( _
   ByVal x As NullableInt32, _
   ByVal conventionalNullValue As String, _
   ByVal format As String _
) As String
public static string From(
   NullableInt32 x,
   string conventionalNullValue,
   string format


The NullableInt32 value to convert.
The String value that conventionally represent the Null value.
A string that specifies the return format of x if it is not Null.

Return Value

conventionalNullValue if x is Null otherwise the equivalent string of the Value of x formatted as specified by format.


If format is a null reference (Nothing in Visual Basic) or an empty string (""), general format specifier ("G") will be used.

The NumberFormatInfo for the current culture is used when applying fomatting.


Exception TypeCondition
FormatExceptionx is not Null and the format is invalid for an Int32.

See Also

NullConvert Class | NullableTypes.HelperFunctions Namespace | NullConvert.From Overload List