string templates = "group simple; vardef(type,name) ::= \"<name>的属性是<type>;\" 后面还有好多字符串,我就不写这么多吧\"";
StringTemplateGroup group = new StringTemplateGroup(new StringReader(templates));
StringTemplate st = group.GetInstanceOf("vardef");
st.SetAttribute("type", "int");
st.SetAttribute("name", "foo");
结果是:foo的属性是int;
[责任编辑:jumbot]