Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UniqueStyleString

A unique integer-based representation for common strings used in various style algorithms for faster comparison and reduced memory footprint.
Read time 1 minuteLast updated 13 days ago

Definition

public readonly struct UniqueStyleString : IEquatable<UniqueStyleString>

Remarks

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

Static Fields

Value

Description

EmptyThe UniqueStyleString representation of an empty string.
NullThe UniqueStyleString representation of a
null
string.

Constructors

Constructor

Description

UniqueStyleString(System.String)Creates a new UniqueStyleString from a string.

Properties

Property

Description

idAn integer representing the underlying string uniquely.
IsEmptyReturns whether this UniqueStyleString represents an empty string.
IsNullReturns whether this UniqueStyleString represents a
null
string.

Methods

Method

Description

EqualsComputes whether or not this UniqueStyleString is identical another given object.
GetHashCodeComputes a valid hash code for this UniqueStyleString.
IsNullOrEmptyReturns
true
if this UniqueStyleString represents either a
null
or empty string.
IsSameCompares this UniqueStyleString to a given string for equality.
ToStringReturns a string value with the same content as the string that was used to obtain this UniqueStyleString.

Static Methods

Method

Description

TryGetAttempts to retrieve an existing UniqueStyleString from a string value.

Operators

Operator

Description

operator ==Computes whether or not this UniqueStyleString is identical to the other given UniqueStyleString.
operator !=Computes whether or not this UniqueStyleString is different from the other given UniqueStyleString.