Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PackedStringArray

A packed array of Strings.

Description

An array specifically designed to hold Strings. Packs data tightly, so it saves memory for large array sizes.

If you want to join the strings in the array, use String.join.

var string_array = PackedStringArray(["hello", "world"])
var string = " ".join(string_array)
print(string) # "hello world"

Note

There are notable differences when using this API with C#. See C# API differences to GDScript for more information.

Tutorials

Constructors

PackedStringArray

PackedStringArray()

PackedStringArray

PackedStringArray(from: PackedStringArray)

PackedStringArray

PackedStringArray(from: Array)

Methods

bool

append(value: String)

void

append_array(array: PackedStringArray)

int

bsearch(value: String, before: bool = true)

void

clear()

int

count(value: String) const

PackedStringArray

duplicate()

void

fill(value: String)

int

find(value: String, from: int = 0) const

bool

has(value: String) const

int

insert(at_index: int, value: String)

bool

is_empty() const

bool

push_back(value: String)

void

remove_at(index: int)

int

resize(new_size: int)

void

reverse()

int

rfind(value: String, from: int = -1) const

void

set(index: int, value: String)

int

size() const

PackedStringArray

slice(begin: int, end: int = 2147483647) const

void

sort()

PackedByteArray

to_byte_array() const

Operators

bool

operator !=(right: PackedStringArray)

PackedStringArray

operator +(right: PackedStringArray)

bool

operator ==(right: PackedStringArray)

String

operator [](index: int)


Constructor Descriptions