+2 votes

As the title suggests, I'm setting a label's text to the string of an array. The issue is, it includes the brackets in said array. Any fixes? In addition, if anyone is willing to help, how can I convert this array to a list instead?

Godot version 3.4.2
in Engine by (103 points)

1 Answer

0 votes

You can do something like this

var array = ["1", "2", "3"]
var st = ""
for i in array:
    st = st + str(i)
print(st) 

to iterate over an array and add it to a string

by (1,417 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.