String

This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.

Constructors

this
this(StringName n)
Undocumented in source.
this
this(godot_string str)
Undocumented in source.
this
this(S num)

Numeric constructor. S can be a built-in numeric type.

this
this(S str)

wchar_t constructor. S can be a slice or a null-terminated pointer.

this
this(S str)

UTF-8 constructor. S can be a slice (like string) or a null-terminated pointer.

Destructor

~this
~this()
Undocumented in source.

Alias This

_string

Members

Aliases

toString
alias toString = data
Undocumented in source.

Functions

_bind
String_Bind _bind()
Undocumented in source. Be warned that the author may not have intended to support it.
_defaultCtor
void _defaultCtor()
Undocumented in source. Be warned that the author may not have intended to support it.
data
immutable(wchar_t)[] data()

Returns a slice of the wchar_t data without the zero terminator.

empty
bool empty()
format
String format(V values)
Undocumented in source. Be warned that the author may not have intended to support it.
format
String format(V values, String placeholder)
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length()

Returns the length of the wchar_t array, minus the zero terminator.

opAssign
void opAssign(String other)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(string other)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
String opBinary(String other)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(String s)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(String other)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
char32_t opIndex(size_t idx)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
char32_t opIndex(size_t idx)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(String other)
Undocumented in source. Be warned that the author may not have intended to support it.
ptr
immutable(char32_t)* ptr()

Returns a pointer to the wchar_t data. Always zero-terminated.

toHash
hash_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
utf8
CharString utf8()
Undocumented in source. Be warned that the author may not have intended to support it.

Unions

_String
union _String
Undocumented in source.

Variables

_string
_String _string;
Undocumented in source.

Meta