語言

Point.ToString 方法

定義

能呈現 String 這個 Point 結構。

多載

名稱 Description
ToString()

會產生 String 此 Point的表示。

ToString(IFormatProvider)

會產生 String 此 Point的表示。

ToString()

會產生 String 此 Point的表示。

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

傳回

String A 包含XY此Point結構的值。

範例

以下範例說明如何利用此 ToString 方法取得 String 結構的表示 Point 。

private String toStringExample()
{

    Point point1 = new Point(10, 5);

    // Get a string representation of a Point structure.
    // pointString is equal to 10,5	.
    String stringResult = point1.ToString();

    return stringResult;
}
Private Function toStringExample() As String

    Dim point1 As New Point(10, 5)

    ' Get a string representation of a Point structure.
    ' pointString is equal to 10,5	.
    Dim stringResult As String = point1.ToString()

    Return stringResult

End Function

適用於

ToString(IFormatProvider)

會產生 String 此 Point的表示。

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

參數

provider
IFormatProvider

文化特定的格式資訊。

傳回

String A 包含XY此Point結構的值。

適用於