0 votes

for example:

this array:

var array = [1, 4, '.', 0, 0, 0]

into

14.000

Godot version 3.2.3
in Engine by (15 points)

1 Answer

0 votes
Best answer

You'll probably just need to iterate through the array, convert each element to a string, and concatenate the results. Here's a function that does basically that:

func array_to_string(arr: Array) -> String:
    var s = ""
    for i in arr:
        s += String(i)
    return s

Call it like this:

var array = [1, 4, '.', 0, 0, 0]
var s = array_to_string(array)
print(s)
by (19,238 points)
selected by
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 Frequently asked questions and 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 [email protected] with your username.