# RemoveVariant(string, string)

> Removes one variant value from a key's entry in this table.

## Definition

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

```csharp
public bool RemoveVariant(string key, string variantKey)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The key text.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The selector key to remove the value for.

### Returns

| Type                                                          | Description                                             |
| ------------------------------------------------------------- | ------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` when the entry held variants; otherwise `false`. |

### Remarks

Removes the value stored for `variantKey` in this locale's table only. The entry and its default value stay, and resolution for that variant key falls back to the default. The key stays registered on the shared [VariantSelectorMetadata](/engine/6000.7/script-reference/unity/localization/variantselectormetadata.md), because other locale tables may still hold values for it; unregister it with [VariantSelectorMetadata.RemoveKey](/engine/6000.7/script-reference/unity/localization/variantselectormetadata/removekey.md) once every locale has dropped it. Does nothing when the key or variant does not exist.

Additional Resources: [ResourceTable.AddStringVariant](/engine/6000.7/script-reference/unity/localization/resourcetable/addstringvariant.md), [IVariantSelector](/engine/6000.7/script-reference/unity/localization/ivariantselector.md)

Make a key vary by storefront from script.

### Examples

```csharp
namespace Unity.Localization.Samples
{
    public static class AddVariantByScriptExample
    {
        public static void MakeWishlistVaryByStorefront(ResourceTable table)
        {
            // The default value, used wherever no variant matches.
            table.AddStringEntry("wishlist", "Add to wishlist");

            // The selector lives on the shared key, so every locale resolves the same way.
            var key = table.SharedData.GetEntry("wishlist");
            if (key.Metadata.GetMetadata<VariantSelectorMetadata>() == null)
                key.Metadata.AddMetadata(new VariantSelectorMetadata(new StorefrontVariantSelector()));

            // The value this locale shows when the selector reports "GOG".
            table.AddStringVariant("wishlist", "GOG", "Add to GOG wishlist");
        }

        public static void RemoveTheVariant(ResourceTable table)
        {
            table.RemoveVariant("wishlist", "GOG");
        }
    }
}
```
