This is in continuation to my previous post where I discussed about splitting the string on Delimiter basis. Here I would give an example of the opposite ; Joining various strings in an array to a single string using a delimiter.
It is possible by using Join method.
String Words = new String; Words="My"; Words="Name"; Words="is"; Words="Ashwani"; String Sentence = String.Join(" ",Words); Output: Sentence = My name is Ashwani
In my case I used it with a comma delimiter as:
String Hobby = String.Join(",", Hobbies);
This joined all the hobbies of a person in different index of an Array(String) Hobbies to a single String Hobby using Comma separated;