NullableStructExtensionToStringT Method (NullableT, String, IFormatProvider, String) |
Formats a nullable struct.
Namespace: ArtDatabankenAssembly: ArtDatabanken (in ArtDatabanken.dll) Version: 1.3.0.0 (1.3.0.0)
Syntax public static string ToString<T>(
this Nullable<T> source,
string format,
IFormatProvider provider,
string defaultValue
)
where T : struct, new(), IFormattable
<ExtensionAttribute>
Public Shared Function ToString(Of T As {Structure, New, IFormattable}) (
source As Nullable(Of T),
format As String,
provider As IFormatProvider,
defaultValue As String
) As String
public:
[ExtensionAttribute]
generic<typename T>
where T : value class, gcnew(), IFormattable
static String^ ToString(
Nullable<T> source,
String^ format,
IFormatProvider^ provider,
String^ defaultValue
)
[<ExtensionAttribute>]
static member ToString :
source : Nullable<'T> *
format : string *
provider : IFormatProvider *
defaultValue : string -> string when 'T : struct, new() and IFormattable
Parameters
- source
- Type: SystemNullableT
The value. - format
- Type: SystemString
The format string.
If null use the default format defined for the type of the IFormattable implementation. - provider
- Type: SystemIFormatProvider
The format provider.
If null the default provider is used. - defaultValue
- Type: SystemString
The string to show when the source is null.
If null an empty string is returned.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:ArtDatabanken.NullableStructExtension.ToString``1(System.Nullable{``0},System.String,System.IFormatProvider,System.String)"]
Return Value
Type:
StringThe formatted string or the default value if the source is
null.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
NullableT. 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).
See Also