public class MyData
{
string[] values = {"a","b","c","d","e","f","h","k","l"};
public string GetValue(Match m)
{
string n = m.Groups[1].Value;
return values[Convert.ToInt32(n)];
}
}
static void Test70()
{
string s = "bbs.aspx?ID={8}&TypeID={3}";
Regex re = new Regex(@"\{(\d+)\}");
MyData md = new MyData();
string s2 = re.Replace(s,new MatchEvaluator(md.GetValue));
Console.WriteLine(s2);
}