Vector.ToString Method

Definition

Returns the string representation of this Vector structure.

Overloads

ToString()

Returns the string representation of this Vector structure.

ToString(IFormatProvider)

Returns the string representation of this Vector structure with the specified formatting information.

ToString()

Returns the string representation of this Vector structure.

C#
public override string ToString();

Returns

A string that represents the X and Y values of this Vector.

Examples

The following example shows how to use this method to get a string representation of a Vector.

C#
private String toStringExample()
{

    Vector vector1 = new Vector(20, 30);

    // vectorString is equal to "20,30".
    String stringResult = vector1.ToString();

    return stringResult;
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

ToString(IFormatProvider)

Returns the string representation of this Vector structure with the specified formatting information.

C#
public string ToString(IFormatProvider provider);

Parameters

provider
IFormatProvider

The culture-specific formatting information.

Returns

A string that represents the X and Y values of this Vector.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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