# ContainsName(string)

> Determines whether a variable is stored under the given name.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public bool ContainsName(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The variable name to look for.

### Returns

| Type                                                          | Description                                                          |
| ------------------------------------------------------------- | -------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` when a variable is stored under the name; otherwise, `false`. |

### Remarks

Lookup is case-sensitive and matches the whitespace-normalized name assigned by [LocalVariablesGroup.Add](/engine/6000.7/script-reference/unity/localization/localvariablesgroup/add.md).

Check whether a variable exists before using it.

### Examples

```csharp
using Unity.Localization;
using Unity.SmartStrings.PersistentVariables;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class LocalVariablesGroupContainsNameExample
    {
        public void Check()
        {
            var group = new LocalVariablesGroup();
            group.Add(new IntVariable { Value = 5 }, "score");
            if (group.ContainsName("score"))
                Debug.Log("Score variable is set.");
        }
    }
}
```
