string s="1.doc,2.doc,3.doc,";
char spliter={','};
string str[]=s.Split(spliter);
s = s.Trim().Substring(0, s.Trim().Length - 1);
String [] a = s.Split(new char[] {','});
string s = "1.doc,2.doc,3.doc,";
if (s[s.Length - 1].Equals(',') == true)
{
s = s.Substring(0, s.Length - 1);
}
string[] temp = s.Split(',');
string[] a = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEnptyEntries);