collapse array into string

PHOTO EMBED

Tue May 30 2023 15:33:59 GMT+0000 (Coordinated Universal Time)

Saved by @vs #bash

# Define an array
my_array=("Element 1" "Element 2" "Element 3")
# Set the IFS (Internal Field Separator) to comma
IFS=','
# Collapse the array into a string
collapsed_string="${my_array[*]}"
# Print the collapsed string
echo "$collapsed_string"
content_copyCOPY