# UniqueStyleString

> A unique integer-based representation for common strings used in various style algorithms for faster comparison and reduced memory footprint.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [IEquatable\<UniqueStyleString>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public readonly struct UniqueStyleString : IEquatable<UniqueStyleString>
```

## Remarks

Ids may very between consecutive runs and may be regenerated on domain reload.

## Static Fields

| Value                                                                                      | Description                                              |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| [Empty](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/empty.md) | The UniqueStyleString representation of an empty string. |
| [Null](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/null.md)   | The UniqueStyleString representation of a `null` string. |

## Constructors

| Constructor                                                                                                          | Description                                    |
| -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [UniqueStyleString(System.String)](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/ctor.md) | Creates a new UniqueStyleString from a string. |

## Properties

| Property                                                                                       | Description                                                        |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [id](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/id.md)           | An integer representing the underlying string uniquely.            |
| [IsEmpty](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/isempty.md) | Returns whether this UniqueStyleString represents an empty string. |
| [IsNull](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/isnull.md)   | Returns whether this UniqueStyleString represents a `null` string. |

## Methods

| Method                                                                                                     | Description                                                                                                |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [Equals](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/equals.md)               | Computes whether or not this UniqueStyleString is identical another given object.                          |
| [GetHashCode](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/gethashcode.md)     | Computes a valid hash code for this UniqueStyleString.                                                     |
| [IsNullOrEmpty](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/isnullorempty.md) | Returns `true` if this UniqueStyleString represents either a `null` or empty string.                       |
| [IsSame](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/issame.md)               | Compares this UniqueStyleString to a given string for equality.                                            |
| [ToString](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/tostring.md)           | Returns a string value with the same content as the string that was used to obtain this UniqueStyleString. |

## Static Methods

| Method                                                                                       | Description                                                             |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [TryGet](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/tryget.md) | Attempts to retrieve an existing UniqueStyleString from a string value. |

## Operators

| Operator                                                                                                 | Description                                                                                         |
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [operator ==](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/op-equality.md)   | Computes whether or not this UniqueStyleString is identical to the other given UniqueStyleString.   |
| [operator !=](/engine/6000.7/script-reference/unityengine/uielements/uniquestylestring/op-inequality.md) | Computes whether or not this UniqueStyleString is different from the other given UniqueStyleString. |
