Class StringName
- Namespace
- Godot
- Assembly
- GodotSharp.dll
StringNames are immutable strings designed for general-purpose representation of unique names. 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.
public sealed class StringName : IDisposable, IEquatable<StringName>
- Inheritance
-
StringName
- Implements
- Inherited Members
Constructors
StringName()
Constructs an empty StringName.
public StringName()
StringName(string)
Constructs a StringName from the given name
string.
public StringName(string name)
Parameters
name
stringString to construct the StringName from.
Properties
IsEmpty
Check whether this StringName is empty.
public bool IsEmpty { get; }
Property Value
- bool
If the StringName is empty.
Methods
Dispose()
Disposes of this StringName.
public void Dispose()
Dispose(bool)
public void Dispose(bool disposing)
Parameters
disposing
bool
Equals(in godot_string_name)
public bool Equals(in godot_string_name other)
Parameters
other
godot_string_name
Returns
Equals(StringName)
public bool Equals(StringName other)
Parameters
other
StringName
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
~StringName()
protected ~StringName()
GetHashCode()
public override int GetHashCode()
Returns
ToString()
Converts this StringName to a string.
public override string ToString()
Returns
- string
A string representation of this StringName.
Operators
operator ==(in godot_string_name, StringName)
public static bool operator ==(in godot_string_name left, StringName right)
Parameters
left
godot_string_nameright
StringName
Returns
operator ==(StringName, in godot_string_name)
public static bool operator ==(StringName left, in godot_string_name right)
Parameters
left
StringNameright
godot_string_name
Returns
operator ==(StringName, StringName)
public static bool operator ==(StringName left, StringName right)
Parameters
left
StringNameright
StringName
Returns
implicit operator string(StringName)
Converts a StringName to a string.
public static implicit operator string(StringName from)
Parameters
from
StringNameThe StringName to convert.
Returns
implicit operator StringName(string)
Converts a string to a StringName.
public static implicit operator StringName(string from)
Parameters
from
stringThe string to convert.
Returns
operator !=(in godot_string_name, StringName)
public static bool operator !=(in godot_string_name left, StringName right)
Parameters
left
godot_string_nameright
StringName
Returns
operator !=(StringName, in godot_string_name)
public static bool operator !=(StringName left, in godot_string_name right)
Parameters
left
StringNameright
godot_string_name
Returns
operator !=(StringName, StringName)
public static bool operator !=(StringName left, StringName right)
Parameters
left
StringNameright
StringName