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"

Примечание

There are notable differences when using this API with C#. See API различия C# и GDScript for more information.

Tutorials

Constructors

PackedStringArray

PackedStringArray ( )

PackedStringArray

PackedStringArray ( PackedStringArray from )

PackedStringArray

PackedStringArray ( Array from )

Methods

bool

append ( String value )

void

append_array ( PackedStringArray array )

int

bsearch ( String value, bool before=true )

void

clear ( )

int

count ( String value ) const

PackedStringArray

duplicate ( )

void

fill ( String value )

int

find ( String value, int from=0 ) const

bool

has ( String value ) const

int

insert ( int at_index, String value )

bool

is_empty ( ) const

bool

push_back ( String value )

void

remove_at ( int index )

int

resize ( int new_size )

void

reverse ( )

int

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

void

set ( int index, String value )

int

size ( ) const

PackedStringArray

slice ( int begin, int end=2147483647 ) const

void

sort ( )

PackedByteArray

to_byte_array ( ) const

Operators

bool

operator != ( PackedStringArray right )

PackedStringArray

operator + ( PackedStringArray right )