Just few ingredients: String.Format() method, StringBuilder class and regular expressions, but you have to cook it yourself, because I'm affraid there is no ready-made solution.