Point.ToString Method

Definition

Creates a String representation of this Point structure.

Overloads

ToString()

Creates a String representation of this Point.

ToString(IFormatProvider)

Creates a String representation of this Point.

ToString()

Creates a String representation of this Point.

C#
public override string ToString();

Returns

A String containing the X and Y values of this Point structure.

Examples

The following example shows how to use the ToString method to get a String representation of a Point structure.

C#
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;
}

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

ToString(IFormatProvider)

Creates a String representation of this Point.

C#
public string ToString(IFormatProvider provider);

Parameters

provider
IFormatProvider

Culture-specific formatting information.

Returns

A String containing the X and Y values of this Point structure.

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10