# Format

> Replaces the format items in the specified format string with the string representation or the corresponding object.

## Definition

* **Type:** Method
* **Namespace:** [Unity.SmartStrings](/engine/6000.7/script-reference/unity/smartstrings.md)
* **Assembly:** UnityEngine.SmartStringsModule

## Format(string, Object\[])

Replaces the format items in the specified format string with the string representation or the corresponding object.

```csharp
public static string Format(string format, params object[] args)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): The objects to format.

### Returns

| Type                                                           | Description                                                                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The format items in the specified format string replaced with the string representation or the corresponding object. |

### Remarks

Use [Smart.Default](/engine/6000.7/script-reference/unity/smartstrings/smart/default.md) or [SmartFormatter](/engine/6000.7/script-reference/unity/smartstrings/smartformatter.md) for more `Format(...)` overloads.

## Format(IFormatProvider, string, Object\[])

Replaces the format items in the specified format string with the string representation or the corresponding object.

```csharp
public static string Format(IFormatProvider provider, string format, params object[] args)
```

### Parameters

**** (\[IFormatProvider]\(https\://learn.microsoft.com/dotnet/api/system.iformatprovider)): The IFormatProvider to use.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): The objects to format.

### Returns

| Type                                                           | Description                                                                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The format items in the specified format string replaced with the string representation or the corresponding object. |

### Remarks

Use [Smart.Default](/engine/6000.7/script-reference/unity/smartstrings/smart/default.md) or [SmartFormatter](/engine/6000.7/script-reference/unity/smartstrings/smartformatter.md) for more `Format(...)` overloads.

## Format(string, Object, Object, Object)

Replaces the format items in the specified format string with the string representation or the corresponding object.

```csharp
public static string Format(string format, object arg0, object arg1, object arg2)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The first object to format.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The second object to format.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The third object to format.

### Returns

| Type                                                           | Description                                                                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The format items in the specified format string replaced with the string representation or the corresponding object. |

### Remarks

Use [Smart.Default](/engine/6000.7/script-reference/unity/smartstrings/smart/default.md) or [SmartFormatter](/engine/6000.7/script-reference/unity/smartstrings/smartformatter.md) for more `Format(...)` overloads.

## Format(string, Object, Object)

Replaces the format items in the specified format string with the string representation or the corresponding object.

```csharp
public static string Format(string format, object arg0, object arg1)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The first object to format.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The second object to format.

### Returns

| Type                                                           | Description                                                                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The format items in the specified format string replaced with the string representation or the corresponding object. |

### Remarks

Use [Smart.Default](/engine/6000.7/script-reference/unity/smartstrings/smart/default.md) or [SmartFormatter](/engine/6000.7/script-reference/unity/smartstrings/smartformatter.md) for more `Format(...)` overloads.

## Format(string, Object)

Replaces the format items in the specified format string with the string representation or the corresponding object.

```csharp
public static string Format(string format, object arg0)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A composite format string.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to format.

### Returns

| Type                                                           | Description                                                                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The format items in the specified format string replaced with the string representation or the corresponding object. |

### Remarks

Use [Smart.Default](/engine/6000.7/script-reference/unity/smartstrings/smart/default.md) or [SmartFormatter](/engine/6000.7/script-reference/unity/smartstrings/smartformatter.md) for more `Format(...)` overloads.
