I'm implementing a customize toJson() method.
One of my class member is a dictionary.
I did :
sb.Append("\"DateSource\" : {");
foreach (var row in DateSource)
{
sb.Append("[");
sb.Append(string.Format("\"RowKey\" : {0}", row.Key));
sb.Append(string.Format("\"RowData\" : {0}", row.Value));
sb.Append("]");
}
sb.Append("}");
How can I avoid the last comma in the conversion ?