Search This Blog

Monday, August 24, 2009

Commma Elemination from Comma Separatoe


string ids= string.Empty;
foreach (User objUser in dtUser)
{
ids= ids+ obiUser.UserId.ToString() + ",";
}
if (ids.Length > 0)
{
ids= ids.Substring(0, ids.Length - 1);
}

Just devide the whole string into a substring upto the leangth -1 and place it to a string

No comments: