Struct 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.

struct String ;

Constructors

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

Methods

NameDescription
data Returns a slice of the wchar_t data without the zero terminator.
empty
length Returns the length of the wchar_t array, minus the zero terminator.
ptr Returns a pointer to the wchar_t data. Always zero-terminated.