using System;
using System.Collections.Generic;
using System.Text;
namespace Aspose.HTML.Tutorial
{
public static class AsposeHelper
{
public static string ToDefintionList(
this Dictionary<string, string> source)
{
var sb = new StringBuilder("<dl>");
foreach (var key in source.Keys)
{
sb.Append("<dt>");
sb.Append(key);
sb.Append("</dt><dd>");
sb.Append(source[key]);
sb.Append("</dd></dl>");
}
return sb.ToString();
}
}
class Program
{
static void Main(string[] args)
{
var computerTerms = new Dictionary<string, string>
{
{ "RAM", "Random Access Memory" },
{ "ROM", "Read-Only Memory" }
};
Console.WriteLine(computerTerms.ToDefintionList());
}
}
}
Comments