# ToString

> Formats this vector as a string.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## ToString()

Formats this vector as a string.

```csharp
public override readonly string ToString()
```

### Returns

| Type                                                           | Description                                                                         |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | A formatted string for this vector. Defaults to two digits displayed (format="F2"). |

### Remarks

Defaults to two digits displayed (format="F2"). For more information, see Microsoft's documentation on [Standard numeric format strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#FFormatString).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Vector4 vector = new Vector4(1, 2, 3, 4);
        Debug.Log(vector.ToString()); // output displayed as: "(1.00, 2.00, 3.00, 4.00)"
    }
}
```

## ToString(string)

Formats this vector as a string.

```csharp
public readonly string ToString(string format)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A numeric format string.

### Returns

| Type                                                           | Description                                                                         |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | A formatted string for this vector. Defaults to two digits displayed (format="F2"). |

### Remarks

Defaults to two digits displayed (format="F2"). For more information, see Microsoft's documentation on [Standard numeric format strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#FFormatString).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Vector4 vector = new Vector4(1, 2, 3, 4);
        Debug.Log(vector.ToString()); // output displayed as: "(1.00, 2.00, 3.00, 4.00)"
    }
}
```

## ToString(string, IFormatProvider)

Formats this vector as a string.

```csharp
public readonly string ToString(string format, IFormatProvider formatProvider)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A numeric format string.**** (\[IFormatProvider]\(https\://learn.microsoft.com/dotnet/api/system.iformatprovider)): An object that specifies culture-specific formatting.

### Returns

| Type                                                           | Description                                                                         |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | A formatted string for this vector. Defaults to two digits displayed (format="F2"). |

### Remarks

Defaults to two digits displayed (format="F2"). For more information, see Microsoft's documentation on [Standard numeric format strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#FFormatString).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Vector4 vector = new Vector4(1, 2, 3, 4);
        Debug.Log(vector.ToString()); // output displayed as: "(1.00, 2.00, 3.00, 4.00)"
    }
}
```
