.NET: Is there a String.Format form for inserting the value of an object property into a string?
问题 I think the direct answer to the question is 'No' but I'm hoping that someone has written a real simple library to do this (or I can do it...ugh...) Let me demonstrate what I am looking for with an example. Suppose I had the following: class Person { string Name {get; set;} int NumberOfCats {get; set;} DateTime TimeTheyWillDie {get; set;} } I would like to be able to do something like this: static void Main() { var p1 = new Person() {Name="John", NumberOfCats=0, TimeTheyWillDie=DateTime.Today