public string getIncomingMsg(string profileId, int days) { string strArray = string.Empty; try { TwitterMessageRepository objtwttatsRepo = new TwitterMessageRepository(); ArrayList alstTwt = objtwttatsRepo.gettwtMessageStatsByProfileId(profileId, days); string str = string.Empty; // strArray = "["; int cnt = 0; if (alstTwt.Count > 0) { for (int i = 0; i < alstTwt.Count; i++) { strArray = strArray + alstTwt[i].ToString() + ","; cnt++; } } if (cnt < 7) { for (int j = 0; j < 7 - cnt; j++) { str = str + "0,"; } } strArray = str + strArray.Substring(0, strArray.Length - 1); // strArray += "]"; } catch (Exception Err) { Console.Write(Err.StackTrace); } return(strArray); }