Convert Dictionary to String
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSAdmin.Core.Utils
{
public static class DictionaryExtensions
{
public static string ConvertToString(this IDictionary<string, object> dict) {
string result = string.Empty;
if (dict != null) {
foreach (var v in dict) {
result += string.Format("{0}={1}\n", v.Key, v.Value.ToString());
}
}
return result;
}
}
}
Related examples in the same category