I'm trying to merge array of string with \n, but didn't get any solution. I have following types of array which contains section names.
let arrSectionName = [
"Section 1",
"Section 2",
"Section 3",
"Section 4",
"Section 5",
"Section 6",
]
Now, I want this string from above array:
"Section 1 \nSection 2 \nSection 3 \nSection 4 \nSection 5 \nSection 6"
So Finally message should display as follow:
Alert Message Output:
Following section which are still pending to complete, please verify and try again:
Section 1
Section 2
Section 3
Section 4
Section 5
Section 6
Section name are dynamic, which will be change runtime and store in arrSectionName.
joinedfunction work for me. Thanks.