# CreateStringEntry(ResourceTableCollection, string)

> Adds a string key to a collection across every one of its locale tables.

## Definition

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

```csharp
public static long CreateStringEntry(ResourceTableCollection collection, string key)
```

### Parameters

**** (\[ResourceTableCollection]\(/engine/6000.7/script-reference/unity/localization/editor/resourcetablecollection)): The collection to add the key to.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The key text.

### Returns

| Type                                                        | Description                                                                                  |
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | The new key's stable id, or zero when the collection has no shared data or the key is empty. |

### Remarks

Registers the key in the collection's [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md) and adds an empty [StringEntry](/engine/6000.7/script-reference/unity/localization/stringentry.md) for it to each table, then saves. Checking the key text for empty or duplicate names is the caller's job; an empty key adds nothing and returns zero.

Additional Resources: [LocalizationEditorSettings.AddTable](/engine/6000.7/script-reference/unity/localization/editor/localizationeditorsettings/addtable.md), [ResourceTableCollection](/engine/6000.7/script-reference/unity/localization/editor/resourcetablecollection.md)
