是否有更快或更有效的方式爲字符串添加到列表中比下面的例子?:將字符串添加到列表 - 更快的方法?
List<String> apptList = new List<String>();
foreach (Appointment appointment in appointments){
String subject = appointment.Subject;
//...(continues for another 10 lines)
//...And then manually adding each String to the List:
apptList.Add(subject);
//...(continues for another 10 lines)
//And then send off List apptList to another method
}
你說的'//...(continues另外10行)'是什麼意思?有10個其他字段,你有'字符串fieldname = appointment.FieldName;'? – yoozer8