github_url: | hide |
---|
A packed :ref:`Array<class_Array>` of :ref:`String<class_String>`s.
An :ref:`Array<class_Array>` specifically designed to hold :ref:`String<class_String>`s. Packs data tightly, so it saves memory for large array sizes.
Note: This type is passed by value and not by reference.
- :ref:`PackedStringArray<class_PackedStringArray>` PackedStringArray ( :ref:`Array<class_Array>` from )
Constructs a new PackedStringArray
. Optionally, you can pass in a generic :ref:`Array<class_Array>` that will be converted.
- void append ( :ref:`String<class_String>` string )
Appends an element at the end of the array (alias of :ref:`push_back<class_PackedStringArray_method_push_back>`).
- void append_array ( :ref:`PackedStringArray<class_PackedStringArray>` array )
Appends a PackedStringArray
at the end of this array.
- :ref:`bool<class_bool>` empty ( )
Returns true
if the array is empty.
- :ref:`int<class_int>` insert ( :ref:`int<class_int>` idx, :ref:`String<class_String>` string )
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (idx == size()
).
- void invert ( )
Reverses the order of the elements in the array.
- void push_back ( :ref:`String<class_String>` string )
Appends a string element at end of the array.
- void remove ( :ref:`int<class_int>` idx )
Removes an element from the array by index.
- void resize ( :ref:`int<class_int>` idx )
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
- void set ( :ref:`int<class_int>` idx, :ref:`String<class_String>` string )
Changes the :ref:`String<class_String>` at the given index.
- :ref:`int<class_int>` size ( )
Returns the size of the array.