diff options
Diffstat (limited to 'doc/classes/StringName.xml')
-rw-r--r-- | doc/classes/StringName.xml | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml index c19fce9944..ffa1227500 100644 --- a/doc/classes/StringName.xml +++ b/doc/classes/StringName.xml @@ -4,7 +4,9 @@ An optimized string type for unique names. </brief_description> <description> - [StringName]s are immutable strings designed for general-purpose representation of unique names. [StringName] ensures that only one instance of a given name exists (so two [StringName]s with the same value are the same object). Comparing them is much faster than with regular [String]s, because only the pointers are compared, not the whole strings. + [StringName]s 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 [StringName]s with the same value are the same object). Comparing them is much faster than with regular [String]s, 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 [code]&"example"[/code]. + See also [NodePath], which is a similar concept specifically designed to store pre-parsed node paths. </description> <tutorials> </tutorials> @@ -26,18 +28,13 @@ <return type="StringName" /> <argument index="0" name="from" type="String" /> <description> - Creates a new [StringName] from the given [String]. + Creates a new [StringName] from the given [String]. [code]StringName("example")[/code] is equivalent to [code]&"example"[/code]. </description> </constructor> </constructors> <operators> <operator name="operator !="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator !="> - <return type="bool" /> <argument index="0" name="right" type="String" /> <description> </description> @@ -62,11 +59,6 @@ </operator> <operator name="operator =="> <return type="bool" /> - <description> - </description> - </operator> - <operator name="operator =="> - <return type="bool" /> <argument index="0" name="right" type="String" /> <description> </description> |