An optimized string type for unique names.
StringNames are immutable strings designed for general-purpose representation of unique names (also called "string interning").
StringName ensures that only one instance of a given name exists (so two
StringNames with the same value are the same object). Comparing them is much faster than with regular Strings, because only the pointers are compared, not the whole strings.
You will usually just pass a String to methods expecting a
StringName and it will be automatically converted, but you may occasionally want to construct a
StringName ahead of time with
StringName or the literal syntax
See also NodePath, which is a similar concept specifically designed to store pre-parsed node paths.
StringName ( )
hash ( ) const
StringName StringName ( )
Constructs an empty
StringName as a copy of the given
Creates a new
StringName from the given String.
StringName("example") is equivalent to
int hash ( ) const
Returns the 32-bit hash value representing the