FormatterConverter.ToString(Object) 方法

定义

将指定对象转换为 StringConverts the specified object to a String.

public:
 virtual System::String ^ ToString(System::Object ^ value);
public string? ToString (object value);
public string ToString (object value);
override this.ToString : obj -> string
Public Function ToString (value As Object) As String

参数

value
Object

要转换的对象。The object to convert.

返回

String

转换的 value;或者,如果 type 参数为 null,则为 nullThe converted value or null if the type parameter is null.

实现

例外

value 参数为 nullThe value parameter is null.

注解

此方法使用固定区域性 (参阅 CultureInfo.InvariantCulture) 。This method uses the invariant culture (see CultureInfo.InvariantCulture). 若要使用当前区域性或指定区域性,请改用 Convert.ToString 方法。To use the current culture or to specify a culture, use the Convert.ToString method instead. 有关详细信息,请参阅StringConvertValueTypeFor more information, see String, Convert, and ValueType.

适用于