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

定义

返回使用指定区域性的格式化约定格式化格式字符串及其参数生成的字符串。Returns the string that results from formatting the format string along with its arguments by using the formatting conventions of a specified culture.

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

参数

ignored
String

一个字符串。A string. 此参数忽略。This argument is ignored.

formatProvider
IFormatProvider

一个对象,提供区域性特定的格式设置信息。An object that provides culture-specific formatting information.

返回

String

使用 formatProvider 参数的约定格式化的字符串。A string formatted using the conventions of the formatProvider parameter.

实现

注解

此实现调用派生类的 ToString(IFormatProvider) 实现。This implementation calls the derived class' ToString(IFormatProvider) implementation.

此成员是显式接口应用。This member is an explicit interface implementation. 它只能在 FormattableString 实例被强制转换为 IFormattable 接口时使用。It can be used only when the FormattableString instance is cast to an IFormattable interface.

适用于