Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Last active December 15, 2015 04:58
Show Gist options
  • Save bjartwolf/5205026 to your computer and use it in GitHub Desktop.
Save bjartwolf/5205026 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using Antlr4.StringTemplate;
namespace stringtemplatetest
{
class Bjorn
{
public Bjorn(int alder)
{
Alder = alder;
}
public int Alder { get; set; }
}
class Program
{
static void Main(string[] args)
{
var bjorns = new List<Bjorn>
{
new Bjorn(43),
new Bjorn(43),
new Bjorn(3)
};
var hello = new Template("<ul> $bjorns: { bjorn | <li> Bjørnen er : $bjorn.Alder$</li>}$</ul>", '$', '$');
hello.Add("bjorns", bjorns);
Console.Out.WriteLine(hello.Render());
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment