# StringEntry

> Represents a localized string entry that stores a single text value with no variants.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule
* **Inherits from:** [ResourceEntryBase](/engine/6000.7/script-reference/unity/localization/resourceentrybase.md)
* **Implements:** [IStringEntry](/engine/6000.7/script-reference/unity/localization/istringentry.md), [IResourceEntry](/engine/6000.7/script-reference/unity/localization/iresourceentry.md)

```csharp
public class StringEntry : ResourceEntryBase, IStringEntry, IResourceEntry
```

## Remarks

This is the built-in [IStringEntry](/engine/6000.7/script-reference/unity/localization/istringentry.md) kind, holding one locale's text for a key. Add one to a table with [ResourceTable.AddStringEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/addstringentry.md), which also registers the key in the shared data, or construct one for an existing key id and add it with [ResourceTable.AddEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/addentry.md). Whether the value is treated as a Smart String is a per-key flag on the [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md), not on the entry.

Additional Resources: [IStringEntry](/engine/6000.7/script-reference/unity/localization/istringentry.md), [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md), [ResourceEntryBase](/engine/6000.7/script-reference/unity/localization/resourceentrybase.md), [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md)

Add a string entry to a table and read its value.

## Examples

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

namespace Unity.Localization.Samples
{
    public class StringEntryOverviewExample
    {
        public void Run()
        {
            var shared = ScriptableObject.CreateInstance<SharedTableData>();
            shared.TableCollectionName = "UI Text";

            var table = ScriptableObject.CreateInstance<ResourceTable>();
            table.SharedData = shared;
            table.LocaleIdentifier = new LocaleIdentifier("en");

            StringEntry entry = table.AddStringEntry("greeting", "Hello");
            Debug.Log(entry.Value);  // Hello

            entry.Value = "Hi";
            Debug.Log(entry.Value);  // Hi
        }
    }
}
```

## Constructors

| Constructor                                                                                                                                  | Description                    |
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| [StringEntry()](/engine/6000.7/script-reference/unity/localization/stringentry/ctor.md#stringentry\(\))                                      | Creates an empty entry.        |
| [StringEntry(System.Int64,System.String)](/engine/6000.7/script-reference/unity/localization/stringentry/ctor.md#stringentry\(long-string\)) | Creates an entry for a key id. |
