連接字符串以接收ukr:'Ukraine';rus:'Russia';fr:'France'
結果的最佳方式是什麼?連接字符串的最有效方法是什麼?
public class Country
{
public int IdCountry { get; set; }
public string Code { get; set; }
public string Title { get; set; }
}
var lst = new List<Country>();
lst.Add(new Country(){IdCountry = 1, Code = "ukr", Title = "Ukraine"});
lst.Add(new Country() { IdCountry = 2, Code = "rus", Title = "Russia" });
lst.Add(new Country() { IdCountry = 3, Code = "fr", Title = "France" });
string tst = ????
是您的目標模式真的'代碼: '標題';'後面'代碼: '標題','?注意第一對以分號結尾,第二對以逗號結尾。這是故意的嗎? – shanabus 2012-02-19 18:23:58
可能重複[什麼是最好的字符串連接方法使用C#?](http://stackoverflow.com/questions/21078/whats-the-best-string-concatenation-method-using-c) – 2012-02-20 06:24:49
shanabus,模式correcred,謝謝 – Yara 2012-02-20 15:23:27