I found the default implemtation of ToString in the dictionary is not what I want. I would like to have {key=value, ***}.
{key=value, ***}
Any handy way to get it?
No handy way. You'll have to roll your own.
public static string ToPrettyString(this IDictionary dict) { var str = new StringBuilder(); str.Append("{"); foreach (var pair in dict) { str.Append(String.Format(" {0}={1} ", pair.Key, pair.Value)); } str.Append("}"); return str.ToString(); }