An array of strings can be combined with a specific separator using the joinWithSeparator method.
let st = [ "apple", "pie", "potato" ]
st.joinWithSeparator(", ")
As a result, we will have an "apple, pie, potato."
What if I bind strings in my array? Is there an easy way to combine them into one large anchored string?
source
share