편집

다음을 통해 공유


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.

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

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.

private String toStringExample()
{

    Vector vector1 = new Vector(20, 30);

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

    return stringResult;
}
Private Function toStringExample() As String

    Dim vector1 As New Vector(20, 30)

    ' vectorString is equal to "20,30".
    Dim stringResult As String = vector1.ToString()

    Return stringResult

End Function

See also

Applies to

ToString(IFormatProvider)

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

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

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