# DeleteKey(string)

> Removes the given key from the PlayerPrefs. If the key does not exist, PlayerPrefs.DeleteKey has no impact.

## Definition

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

```csharp
public static void DeleteKey(string key)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Remarks

The following example shows a public function called ‘DeleteKey’. The function takes a string variable called ‘KeyName’ as a parameter, which PlayerPrefs.DeleteKey uses to delete the key from the registry.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    public void DeleteKey(string KeyName)
    {
        PlayerPrefs.DeleteKey(KeyName);
    }
}
```
