string[] names = new string[5] { "Matt", "Joanne", "Robert" ,"hello","howareu"};
string str = string.Empty;
int temp=0;
try
{
while (names[temp+1] != null)
{
str += names[temp] + ",";
temp++;
}
}
catch(Exception ee)
{
str += names[temp];
}
Response.Write(str);