QuickOPC User's Guide and Reference
ToString(IFormattable,String) Method



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Extensions Namespace > IFormattableExtension Class > ToString Method : ToString(IFormattable,String) Method
Provides functionality to format the value of an object into a string representation.
A standard or custom format string (see Remarks).
Converts the value of the current object to its equivalent string representation using the specified format.
Syntax
'Declaration
 
<ExtensionAttribute()>
<NotNullAttribute()>
Public Overloads Shared Function ToString( _
   ByVal formattable As IFormattable, _
   ByVal format As String _
) As String
'Usage
 
Dim formattable As IFormattable
Dim format As String
Dim value As String
 
value = IFormattableExtension.ToString(formattable, format)
[Extension()]
[NotNull()]
public static string ToString( 
   IFormattable formattable,
   string format
)
[Extension()]
[NotNull()]
public:
static String^ ToString( 
   IFormattable^ formattable,
   String^ format
) 

Parameters

formattable
Provides functionality to format the value of an object into a string representation.
format
A standard or custom format string (see Remarks).

Return Value

A string representation of value of the current object as specified by format.
Remarks

The format parameter should contain either a standard format specifier or a custom format pattern that defines the format of the returned string. If format is null or an empty string, the general format specifier, 'G', is used.

This method uses formatting information derived from the current culture.

Requirements

Target Platforms: .NET Framework: Windows 7 with SP1, Windows Server 2012; .NET Core: Linux, Microsoft Windows

See Also

Reference

IFormattableExtension Class
IFormattableExtension Members
Overload List