Vector2.ToString 方法

定义

返回当前 Vector2 实例的字符串表示形式。Returns the string representation of the current Vector2 instance.

重载

ToString()

使用默认格式设置返回当前实例的字符串表示形式。Returns the string representation of the current instance using default formatting.

ToString(String)

通过使用指定格式字符串设置各个元素的格式,来返回当前实例的字符串表示形式。Returns the string representation of the current instance using the specified format string to format individual elements.

ToString(String, IFormatProvider)

通过使用指定格式字符串设置各个元素的格式并使用指定格式提供程序定义特定于区域性的格式设置,来返回当前实例的字符串表示形式。Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting.

ToString()

使用默认格式设置返回当前实例的字符串表示形式。Returns the string representation of the current instance using default formatting.

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

返回

String

当前实例的字符串表示形式。The string representation of the current instance.

注解

此方法返回一个字符串,其中,矢量的每个元素均使用 "G" (常规) 格式字符串和当前线程区域性的格式设置约定进行格式化。This method returns a string in which each element of the vector is formatted using the "G" (general) format string and the formatting conventions of the current thread culture. " <" and "> " 字符用于开始和结束字符串,当前区域性的 NumberFormatInfo.NumberGroupSeparator 属性后跟一个空格用于分隔每个元素。The "<" and ">" characters are used to begin and end the string, and the current culture's NumberFormatInfo.NumberGroupSeparator property followed by a space is used to separate each element.

适用于

ToString(String)

通过使用指定格式字符串设置各个元素的格式,来返回当前实例的字符串表示形式。Returns the string representation of the current instance using the specified format string to format individual elements.

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

参数

format
String

一个标准或自定义数字格式字符串,用于定义各个元素的格式。A standard or custom numeric format string that defines the format of individual elements.

返回

String

当前实例的字符串表示形式。The string representation of the current instance.

注解

此方法返回一个字符串,其中使用向量的每个元素 format 以及当前区域性的格式设置约定。This method returns a string in which each element of the vector is formatted using format and the current culture's formatting conventions. " <" and "> " 字符用于开始和结束字符串,当前区域性的 NumberFormatInfo.NumberGroupSeparator 属性后跟一个空格用于分隔每个元素。The "<" and ">" characters are used to begin and end the string, and the current culture's NumberFormatInfo.NumberGroupSeparator property followed by a space is used to separate each element.

适用于

ToString(String, IFormatProvider)

通过使用指定格式字符串设置各个元素的格式并使用指定格式提供程序定义特定于区域性的格式设置,来返回当前实例的字符串表示形式。Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting.

public:
 virtual System::String ^ ToString(System::String ^ format, IFormatProvider ^ formatProvider);
public string ToString (string format, IFormatProvider formatProvider);
public string ToString (string? format, IFormatProvider? formatProvider);
override this.ToString : string * IFormatProvider -> string
Public Function ToString (format As String, formatProvider As IFormatProvider) As String

参数

format
String

一个标准或自定义数字格式字符串,用于定义各个元素的格式。A standard or custom numeric format string that defines the format of individual elements.

formatProvider
IFormatProvider

一个提供特定于区域性的格式设置信息的格式提供程序。A format provider that supplies culture-specific formatting information.

返回

String

当前实例的字符串表示形式。The string representation of the current instance.

实现

注解

此方法返回一个字符串,其中,矢量的每个元素均使用和进行格式设置 format formatProviderThis method returns a string in which each element of the vector is formatted using format and formatProvider. " <" and "> " 字符用于开始和结束字符串,格式提供程序的 NumberFormatInfo.NumberGroupSeparator 属性后跟一个空格用于分隔每个元素。The "<" and ">" characters are used to begin and end the string, and the format provider's NumberFormatInfo.NumberGroupSeparator property followed by a space is used to separate each element.

适用于