語言

Version.IFormattable.ToString(String, IFormatProvider) 方法

定義

使用指定的格式,格式化目前實例的值。

 virtual System::String ^ System.IFormattable.ToString(System::String ^ format, IFormatProvider ^ formatProvider) = IFormattable::ToString;
string IFormattable.ToString(string format, IFormatProvider formatProvider);
string? IFormattable.ToString(string? format, IFormatProvider? formatProvider);
abstract member System.IFormattable.ToString : string * IFormatProvider -> string
override this.System.IFormattable.ToString : string * IFormatProvider -> string
Function ToString (format As String, formatProvider As IFormatProvider) As String Implements IFormattable.ToString

參數

format
String

應該使用的格式。 -或- 一個 null 參考(Nothing 在 Visual Basic 中),用來使用該 IFormattable 實作類型所定義的預設格式。

formatProvider
IFormatProvider

使用哪個服務提供者來格式化這個數值。 -或- null參考(Visual Basic 中的 Nothing)用來取得作業系統當前區域設定的數值格式資訊。

傳回

目前實例在指定格式下的值。

實作

適用於