FormattableString.ToString 方法

定义

返回格式化复合格式字符串及其参数生成的字符串。Returns the string that results from formatting the composite format string along with its arguments.

重载

ToString()

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

ToString(IFormatProvider)

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

ToString()

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

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

使用当前区域性的约定格式化的结果字符串。A result string formatted by using the conventions of the current culture.

ToString(IFormatProvider)

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

public:
 abstract System::String ^ ToString(IFormatProvider ^ formatProvider);
public abstract string ToString (IFormatProvider formatProvider);
override this.ToString : IFormatProvider -> string
Public MustOverride Function ToString (formatProvider As IFormatProvider) As String

参数

formatProvider
IFormatProvider

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

返回

使用 formatProvider 的约定格式化的结果字符串。A result string formatted by using the conventions of formatProvider.

适用于