StringName

    A built-in type for unique strings.

    StringName.swift:25
    class StringName

    StringNames are immutable strings designed for general-purpose representation of unique names (also called “string interning”). Two StringNames with the same value are the same object. Comparing them is extremely fast compared to regular Strings.

    You will usually pass a String to methods expecting a StringName and it will be automatically converted (often at compile time), but in rare cases you can construct a StringName ahead of time with the StringName constructor or, in GDScript, the literal syntax &"example". Manually constructing a StringName allows you to control when the conversion from String occurs or to use the literal and prevent conversions entirely.

    See also NodePath, which is a similar concept specifically designed to store pre-parsed scene tree paths.

    All of String’s methods are available in this class too. They convert the StringName into a string, and they also return a string. This is highly inefficient and should only be used if the string is desired.

    Citizens in SwiftGodot

    Conformances

    Typealiases

    Type members

    Instance members

    Type features

    Instance features