# GetString(string, string)

> Retrieve a String value.

## Definition

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

```csharp
public static string GetString(string key, string defaultValue)
```

### Parameters

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

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### Remarks

Due to the behavior of Unity's serialization system, `SessionState.GetString` returns an empty string instead of `null` when no string value is stored for the key, even if you specify `null` as the `defaultValue`.
