Vala - How to join string[] to string?

Viewed 46

I have a string array:

string[] arr = {"Hello", "World"};

I want to print it or convert it to a string like:

print(arr.join(","));

> "Hello,World"

How can I do this?

1 Answers

Use string.joinv():

string[] arr = {"Hello", "World"};

print(string.joinv(",", arr));

Result:

Hello,World
Related