# Add(string, IVariable)

> Adds a new Global Variable to use during formatting.

## Definition

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

```csharp
public void Add(string name, IVariable variable)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the variable, must be unique. Note the name should not contain any whitespace, if any is found then it will be replaced with with '-'.**** (\[IVariable]\(/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/ivariable)): The variable to use when formatting. See also [BoolVariable](/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/boolvariable.md), [FloatVariable](/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/floatvariable.md), [IntVariable](/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/intvariable.md), [StringVariable](/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/stringvariable.md), [ObjectVariable](/engine/6000.7/script-reference/unity/smartstrings/persistentvariables/objectvariable.md).
